Skip to content

Commit bdae644

Browse files
committed
Add tests for lowercase licence expression operators
1 parent 33b659a commit bdae644

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

flit_core/tests_core/test_config.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,23 @@ def test_license_expr_error(invalid_expr: str):
289289
config.read_pep621_metadata(proj, samples_dir / 'pep621' / 'pyproject.toml')
290290

291291

292+
@pytest.mark.parametrize('invalid_expr', [
293+
"mit or mit",
294+
"or",
295+
"and",
296+
"MIT and MIT",
297+
"MIT AND MIT or MIT",
298+
"MIT AND (MIT or MIT)",
299+
])
300+
def test_license_expr_error_lowercase(invalid_expr: str):
301+
proj = {
302+
'name': 'module1', 'version': '1.0', 'description': 'x',
303+
'license': invalid_expr,
304+
}
305+
with pytest.raises(config.ConfigError, match="must be uppercase"):
306+
config.read_pep621_metadata(proj, samples_dir / 'pep621' / 'pyproject.toml')
307+
308+
292309
@pytest.mark.parametrize('invalid_expr', [
293310
"LicenseRef-foo_bar",
294311
"LicenseRef-foo~bar",

0 commit comments

Comments
 (0)