All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 @pytest.mark.parametrize(
3 ("post_data", "message"),
5 # metadata_version errors.
8 "None is an invalid value for Metadata-Version. "
9 "Error: This field is required. "
11 "https://packaging.python.org/specifications/core-metadata",
14 {"metadata_version": "-1"},
15 "'-1' is an invalid value for Metadata-Version. "
16 "Error: Unknown Metadata Version "
18 "https://packaging.python.org/specifications/core-metadata",
22 {"metadata_version": "1.2"},
23 "'' is an invalid value for Name. "
24 "Error: This field is required. "
26 "https://packaging.python.org/specifications/core-metadata",
29 {"metadata_version": "1.2", "name": "foo-"},
30 "'foo-' is an invalid value for Name. "
31 "Error: Must start and end with a letter or numeral and "
32 "contain only ascii numeric and '.', '_' and '-'. "
34 "https://packaging.python.org/specifications/core-metadata",
38 {"metadata_version": "1.2", "name": "example"},
39 "'' is an invalid value for Version. "
40 "Error: This field is required. "
42 "https://packaging.python.org/specifications/core-metadata",
45 {"metadata_version": "1.2", "name": "example", "version": "dog"},
46 "'dog' is an invalid value for Version. "
47 "Error: Must start and end with a letter or numeral and "
48 "contain only ascii numeric and '.', '_' and '-'. "
50 "https://packaging.python.org/specifications/core-metadata",
54 def test_fails_invalid_post_data(
55 self, pyramid_config, db_request, post_data, message
57 pyramid_config.testing_securitypolicy(userid=1)
58 db_request.POST = MultiDict(post_data)
61 def foo(list_a, list_b):
63 User.query.filter(User.foo == "bar")
64 .filter( # Because foo.
65 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
67 .filter(User.xyz.is_(None))
68 # Another comment about the filtering on is_quux goes here.
69 .filter(db.not_(User.is_pending.astext.cast(db.Boolean).is_(True)))
70 .order_by(User.created_at.desc())
71 .with_for_update(key_share=True)
77 def foo2(list_a, list_b):
78 # Standalone comment reasonably placed.
80 User.query.filter(User.foo == "bar")
82 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
84 .filter(User.xyz.is_(None))
88 def foo3(list_a, list_b):
90 # Standlone comment but weirdly placed.
91 User.query.filter(User.foo == "bar")
93 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
95 .filter(User.xyz.is_(None))