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.
1 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
2 MyLovelyCompanyTeamProjectComponent, # NOT DRY
4 from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import (
5 MyLovelyCompanyTeamProjectComponent as component, # DRY
10 @pytest.mark.parametrize(
11 ("post_data", "message"),
13 # metadata_version errors.
16 "None is an invalid value for Metadata-Version. "
17 "Error: This field is required. "
19 "https://packaging.python.org/specifications/core-metadata",
22 {"metadata_version": "-1"},
23 "'-1' is an invalid value for Metadata-Version. "
24 "Error: Unknown Metadata Version "
26 "https://packaging.python.org/specifications/core-metadata",
30 {"metadata_version": "1.2"},
31 "'' is an invalid value for Name. "
32 "Error: This field is required. "
34 "https://packaging.python.org/specifications/core-metadata",
37 {"metadata_version": "1.2", "name": "foo-"},
38 "'foo-' is an invalid value for Name. "
39 "Error: Must start and end with a letter or numeral and "
40 "contain only ascii numeric and '.', '_' and '-'. "
42 "https://packaging.python.org/specifications/core-metadata",
46 {"metadata_version": "1.2", "name": "example"},
47 "'' is an invalid value for Version. "
48 "Error: This field is required. "
50 "https://packaging.python.org/specifications/core-metadata",
53 {"metadata_version": "1.2", "name": "example", "version": "dog"},
54 "'dog' is an invalid value for Version. "
55 "Error: Must start and end with a letter or numeral and "
56 "contain only ascii numeric and '.', '_' and '-'. "
58 "https://packaging.python.org/specifications/core-metadata",
62 def test_fails_invalid_post_data(
63 self, pyramid_config, db_request, post_data, message
65 pyramid_config.testing_securitypolicy(userid=1)
66 db_request.POST = MultiDict(post_data)
69 def foo(list_a, list_b):
71 User.query.filter(User.foo == "bar")
72 .filter( # Because foo.
73 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
75 .filter(User.xyz.is_(None))
76 # Another comment about the filtering on is_quux goes here.
77 .filter(db.not_(User.is_pending.astext.cast(db.Boolean).is_(True)))
78 .order_by(User.created_at.desc())
79 .with_for_update(key_share=True)
85 def foo2(list_a, list_b):
86 # Standalone comment reasonably placed.
88 User.query.filter(User.foo == "bar")
90 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
92 .filter(User.xyz.is_(None))
96 def foo3(list_a, list_b):
98 # Standlone comment but weirdly placed.
99 User.query.filter(User.foo == "bar")
101 db.or_(User.field_a.astext.in_(list_a), User.field_b.astext.in_(list_b))
103 .filter(User.xyz.is_(None))