Skip to content

Commit 9c6c0ba

Browse files
committed
tests: Fix and execute Obsoletes Python tests
The test script was added in commit b8eab33, but never plugged into meson build script. As a result it was never executed. This patch registers tests/ModulemdTests/obsoletes.py test script to the test suite and fixes the script to use properties of Glib introspection correctly.
1 parent 4b370a1 commit 9c6c0ba

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

modulemd/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ python_tests = {
397397
'moduleindex' : 'tests/ModulemdTests/moduleindex.py',
398398
'modulepackager' : 'tests/ModulemdTests/modulepackager.py',
399399
'modulestream' : 'tests/ModulemdTests/modulestream.py',
400+
'obsoletes' : 'tests/ModulemdTests/obsoletes.py',
400401
'profile' : 'tests/ModulemdTests/profile.py',
401402
'rpmmap' : 'tests/ModulemdTests/rpmmap.py',
402403
'servicelevel' : 'tests/ModulemdTests/servicelevel.py',

modulemd/tests/ModulemdTests/obsoletes.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,38 @@ def test_constructors(self):
3434
# Test that the new() function works
3535
o = Modulemd.Obsoletes.new(1, 2, "testmodule", "teststream", "testmsg")
3636
assert o
37-
assert o.version == 1
38-
assert o.modified == 2
39-
assert o.module_name == "testmodule"
40-
assert o.module_stream == "teststream"
41-
assert o.message == "testmsg"
37+
assert o.props.mdversion == 1
38+
assert o.props.modified == 2
39+
assert o.props.module_name == "testmodule"
40+
assert o.props.module_stream == "teststream"
41+
assert o.props.message == "testmsg"
4242

4343
# Test that keywords are accepted
4444
o = Modulemd.Obsoletes(
45-
version=1,
45+
mdversion=1,
4646
modified=42,
4747
module_name="testmodule2",
4848
module_stream="teststream2",
4949
message="testmessage2",
5050
)
5151
assert o
5252
assert o.validate()
53-
assert o.version == 1
54-
assert o.modified == 42
55-
assert o.module_name == "testmodule2"
56-
assert o.module_stream == "teststream2"
57-
assert o.message == "testmsg2"
53+
assert o.props.mdversion == 1
54+
assert o.props.modified == 42
55+
assert o.props.module_name == "testmodule2"
56+
assert o.props.module_stream == "teststream2"
57+
assert o.props.message == "testmessage2"
5858

5959
def test_copy(self):
6060
o = Modulemd.Obsoletes.new(1, 2, "testmodule", "teststream", "testmsg")
6161
o_copy = o.copy()
6262
assert o_copy
6363
assert o_copy.validate()
64-
assert o_copy.version == 1
65-
assert o_copy.modified == 2
66-
assert o_copy.module_name == "testmodule"
67-
assert o_copy.module_stream == "teststream"
68-
assert o_copy.message == "testmsg"
64+
assert o_copy.props.mdversion == 1
65+
assert o_copy.props.modified == 2
66+
assert o_copy.props.module_name == "testmodule"
67+
assert o_copy.props.module_stream == "teststream"
68+
assert o_copy.props.message == "testmsg"
6969

7070

7171
if __name__ == "__main__":

0 commit comments

Comments
 (0)