From ee0ee95b49b4318861e7c9fe151ac3a7d5e0154d Mon Sep 17 00:00:00 2001 From: Athira_Selvam Date: Wed, 6 Mar 2019 12:57:59 +0530 Subject: [PATCH] Extends tests for ModuleStream.depends_on_stream() [updated]The tests for depends_on_stream() and build_depends_on_stream() is modified to handle empty lists Fixes:https://github.com/fedora-modularity/libmodulemd/issues/192 --- modulemd/v2/tests/ModulemdTests/modulestream.py | 12 +++++++++++- modulemd/v2/tests/test_data/dependson_v2.yaml | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modulemd/v2/tests/ModulemdTests/modulestream.py b/modulemd/v2/tests/ModulemdTests/modulestream.py index 9d52b4aa2..6f0f3afcb 100644 --- a/modulemd/v2/tests/ModulemdTests/modulestream.py +++ b/modulemd/v2/tests/ModulemdTests/modulestream.py @@ -1085,7 +1085,17 @@ def test_depends_on_stream(self): 'platform', 'f28'), False) self.assertEqual(stream.depends_on_stream('base', 'f30'), False) - self.assertEqual(stream.depends_on_stream('base', 'f30'), False) + self.assertEqual( + stream.build_depends_on_stream( + 'base', 'f30'), False) + + if version >= Modulemd.ModuleStreamVersionEnum.TWO: + self.assertEqual( + stream.depends_on_stream( + 'streamname', 'f30'), True) + self.assertEqual( + stream.build_depends_on_stream( + 'streamname', 'f30'), True) if __name__ == '__main__': diff --git a/modulemd/v2/tests/test_data/dependson_v2.yaml b/modulemd/v2/tests/test_data/dependson_v2.yaml index b57bf6a2b..36ac90c86 100644 --- a/modulemd/v2/tests/test_data/dependson_v2.yaml +++ b/modulemd/v2/tests/test_data/dependson_v2.yaml @@ -14,8 +14,10 @@ data: dependencies: - buildrequires: platform: [ f30 ] + streamname: [ ] requires: platform: [ -f28 ] + streamname: [ ] references: community: http://nodejs.org documentation: http://nodejs.org/en/docs