Skip to content

Commit db63498

Browse files
committed
Tests: Decrease number of license identifiers
A large amount of the license identifiers used in the tests made a code review labourious. Especially if they were mostly data, not a license. This patch removes most of them. I kept "ASL 2.0" and "MIT" at places where a real module was copied from Fedora. We cannot change their license. We could only remove the modules. At some places I even used DUMMY identifiers not to trigger the license scanners. This change also affects the specifications. (The tests parse them). Therefore I used this occasion to replace licenses there with multiword license identifiers to show how to use them.
1 parent 9d3a115 commit db63498

19 files changed

+166
-466
lines changed

modulemd/tests/ModulemdTests/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_packager_read_string(self):
137137
description: A minimalistic module description
138138
license:
139139
module:
140-
- MIT
140+
- DUMMY
141141
...
142142
"""
143143
doc = Modulemd.read_packager_string(minimal_valid)
@@ -167,7 +167,7 @@ def test_packager_read_string(self):
167167
summary: A minimal valid module
168168
description: A minimalistic module description
169169
license:
170-
- MIT
170+
- DUMMY
171171
...
172172
"""
173173
doc = Modulemd.read_packager_string(minimal_valid)
@@ -196,7 +196,7 @@ def test_packager_read_string(self):
196196
description: A minimalistic module description
197197
license:
198198
module:
199-
- MIT
199+
- DUMMY
200200
...
201201
"""
202202
doc = Modulemd.read_packager_string(minimal_valid)

modulemd/tests/ModulemdTests/modulepackager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_read_minimal(self):
4545
description: A minimalistic module description
4646
license:
4747
module:
48-
- MIT
48+
- DUMMY
4949
...
5050
"""
5151
stream = Modulemd.ModuleStream.read_string(minimal_valid, True)
@@ -62,7 +62,7 @@ def test_read_extra_values(self):
6262
"data": {
6363
"summary": "A minimal valid module",
6464
"description": "A minimalistic module description",
65-
"license": {"module": ["GPL", "MIT"]},
65+
"license": {"module": ["DUMMY1", "DUMMY2"]},
6666
},
6767
}
6868

@@ -135,7 +135,7 @@ def test_fail_v1(self):
135135
"data": {
136136
"summary": "A minimal valid module",
137137
"description": "A minimalistic module description",
138-
"license": {"module": ["GPL", "MIT"]},
138+
"license": {"module": ["DUMMY1", "DUMMY2"]},
139139
},
140140
}
141141

modulemd/tests/ModulemdTests/modulestream.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,14 @@ def test_licenses(self):
436436
for version in modulestream_versions:
437437
stream = Modulemd.ModuleStream.new(version)
438438

439-
stream.add_content_license("GPLv2+")
440-
assert "GPLv2+" in stream.get_content_licenses()
439+
stream.add_content_license("DUMMY1")
440+
assert "DUMMY1" in stream.get_content_licenses()
441441

442-
stream.add_module_license("MIT")
443-
assert "MIT" in stream.get_module_licenses()
442+
stream.add_module_license("DUMMY2")
443+
assert "DUMMY2" in stream.get_module_licenses()
444444

445-
stream.remove_content_license("GPLv2+")
446-
stream.remove_module_license("MIT")
445+
stream.remove_content_license("DUMMY1")
446+
stream.remove_module_license("DUMMY2")
447447

448448
def test_profiles(self):
449449
for version in modulestream_versions:
@@ -636,7 +636,7 @@ def test_xmd(self):
636636

637637
stream.set_summary("foo")
638638
stream.set_description("bar")
639-
stream.add_module_license("MIT")
639+
stream.add_module_license("DUMMY")
640640
if hasattr(stream, "set_platform"):
641641
stream.set_platform("f33")
642642

@@ -652,7 +652,7 @@ def test_upgrade_v1_to_v2(self):
652652
v1_stream.set_context("ctx")
653653
v1_stream.set_summary("Summary")
654654
v1_stream.set_description("Description")
655-
v1_stream.add_module_license("BSD")
655+
v1_stream.add_module_license("DUMMY")
656656

657657
v1_stream.add_buildtime_requirement("ModuleA", "streamZ")
658658
v1_stream.add_buildtime_requirement("ModuleB", "streamY")
@@ -680,7 +680,7 @@ def test_upgrade_v1_to_v2(self):
680680
Description
681681
license:
682682
module:
683-
- BSD
683+
- DUMMY
684684
dependencies:
685685
- buildrequires:
686686
ModuleA: [streamZ]
@@ -729,9 +729,9 @@ def test_v2_yaml(self):
729729
730730
license:
731731
content:
732-
- BSD
733-
- GPLv2+
734-
module: MIT
732+
- DUMMY1
733+
- DUMMY2
734+
module: DUMMY3
735735
736736
dependencies:
737737
- buildrequires:
@@ -872,9 +872,8 @@ def test_v2_yaml(self):
872872
assert sl.get_eol() is not None
873873
assert sl.get_eol_as_string() == "2099-12-31"
874874

875-
assert "BSD" in stream.get_content_licenses()
876-
assert "GPLv2+" in stream.get_content_licenses()
877-
assert "MIT" in stream.get_module_licenses()
875+
assert "DUMMY1" in stream.get_content_licenses()
876+
assert "DUMMY2" in stream.get_content_licenses()
878877

879878
assert len(stream.get_dependencies()) == 4
880879

@@ -939,7 +938,7 @@ def test_v2_yaml(self):
939938
description: >-
940939
Trivial Description
941940
license:
942-
module: MIT
941+
module: DUMMY
943942
...
944943
"""
945944

@@ -989,9 +988,9 @@ def test_v1_yaml(self):
989988
990989
license:
991990
content:
992-
- BSD
993-
- GPLv2+
994-
module: MIT
991+
- DUMMY1
992+
- DUMMY2
993+
module: DUMMY3
995994
996995
dependencies:
997996
buildrequires:
@@ -1117,9 +1116,8 @@ def test_v1_yaml(self):
11171116
assert sl.get_eol() is not None
11181117
assert sl.get_eol_as_string() == "2099-12-31"
11191118

1120-
assert "BSD" in stream.get_content_licenses()
1121-
assert "GPLv2+" in stream.get_content_licenses()
1122-
assert "MIT" in stream.get_module_licenses()
1119+
assert "DUMMY1" in stream.get_content_licenses()
1120+
assert "DUMMY2" in stream.get_content_licenses()
11231121

11241122
buildrequires = stream.get_buildtime_modules()
11251123
assert len(buildrequires) == 2
@@ -1201,7 +1199,7 @@ def test_v1_yaml(self):
12011199
description: >-
12021200
Trivial Description
12031201
license:
1204-
module: MIT
1202+
module: DUMMY
12051203
...
12061204
"""
12071205

@@ -1511,7 +1509,7 @@ def test_static_context(self):
15111509
module:
15121510
- MIT
15131511
content:
1514-
- MIT and ASL 2.0 and ISC and BSD
1512+
- DUMMY
15151513
dependencies:
15161514
- buildrequires:
15171515
platform: [f29]

modulemd/tests/test-modulemd-common.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ test_modulemd_load_string (void)
108108
" description: >-\n"
109109
" Trivial Description\n"
110110
" license:\n"
111-
" module: MIT\n"
111+
" module: DUMMY\n"
112112
"...\n";
113113
idx = modulemd_load_string (yaml_string, &error);
114114
g_assert_no_error (error);
@@ -378,7 +378,7 @@ test_packager_read_string (void)
378378
" description: >-\n"
379379
" Trivial Description\n"
380380
" license:\n"
381-
" module: MIT\n"
381+
" module: DUMMY\n"
382382
"...\n";
383383
otype = modulemd_read_packager_string (yaml_string, &object, &error);
384384
g_assert_no_error (error);
@@ -419,7 +419,7 @@ test_packager_read_string (void)
419419
" summary: Trivial Summary\n"
420420
" description: >-\n"
421421
" Trivial Description\n"
422-
" license: MIT\n"
422+
" license: DUMMY\n"
423423
"...\n";
424424
otype = modulemd_read_packager_string (yaml_string, &object, &error);
425425
g_assert_no_error (error);
@@ -461,7 +461,7 @@ test_packager_read_string (void)
461461
" description: >-\n"
462462
" Trivial Description\n"
463463
" license:\n"
464-
" module: MIT\n"
464+
" module: DUMMY\n"
465465
"...\n";
466466
otype = modulemd_read_packager_string (yaml_string, &object, &error);
467467
g_assert_no_error (error);
@@ -503,7 +503,7 @@ test_packager_read_string (void)
503503
" description: >-\n"
504504
" Trivial Description\n"
505505
" license:\n"
506-
" module: MIT\n"
506+
" module: DUMMY\n"
507507
"...\n";
508508
otype = modulemd_read_packager_string (yaml_string, &object, &error);
509509
g_assert_no_error (error);

modulemd/tests/test-modulemd-context.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_modulemd_v3_context_valid (void)
3434
" summary: Trivial Summary\n"
3535
" description: >-\n"
3636
" Trivial Description\n"
37-
" license: [MIT]\n"
37+
" license: [DUMMY]\n"
3838
" configurations:\n"
3939
" - context: a234567890\n"
4040
" platform: foo\n"
@@ -63,7 +63,7 @@ test_modulemd_v3_context_overlong (void)
6363
" summary: Trivial Summary\n"
6464
" description: >-\n"
6565
" Trivial Description\n"
66-
" license: [MIT]\n"
66+
" license: [DUMMY]\n"
6767
" configurations:\n"
6868
" - context: a2345678901\n"
6969
" platform: foo\n"
@@ -92,7 +92,7 @@ test_modulemd_v3_context_bad_underscore (void)
9292
" summary: Trivial Summary\n"
9393
" description: >-\n"
9494
" Trivial Description\n"
95-
" license: [MIT]\n"
95+
" license: [DUMMY]\n"
9696
" configurations:\n"
9797
" - context: _\n"
9898
" platform: foo\n"
@@ -118,7 +118,7 @@ test_modulemd_v3_context_duplicate (void)
118118
"data:\n"
119119
" name: foo\n"
120120
" stream: bar\n"
121-
" license: [MIT]\n"
121+
" license: [DUMMY]\n"
122122
" configurations:\n"
123123
" - context: A\n"
124124
" platform: 1\n"
@@ -150,7 +150,7 @@ test_modulemd_v2_context_valid (void)
150150
" description: >-\n"
151151
" Trivial Description\n"
152152
" license:\n"
153-
" module: [MIT]\n"
153+
" module: [DUMMY]\n"
154154
" static_context: true\n"
155155
" context: a234567890_23\n"
156156
"...\n";
@@ -182,7 +182,7 @@ test_modulemd_v2_context_overlong (void)
182182
" description: >-\n"
183183
" Trivial Description\n"
184184
" license:\n"
185-
" module: [MIT]\n"
185+
" module: [DUMMY]\n"
186186
" static_context: true\n"
187187
" context: a234567890_234\n"
188188
"...\n";
@@ -214,7 +214,7 @@ test_modulemd_v2_context_bad_character (void)
214214
" description: >-\n"
215215
" Trivial Description\n"
216216
" license:\n"
217-
" module: [MIT]\n"
217+
" module: [DUMMY]\n"
218218
" static_context: true\n"
219219
" context: '-'\n"
220220
"...\n";

0 commit comments

Comments
 (0)