#1018 Replace dup_nsvc() in test_mbs.py
Merged 10 months ago by mprahl. Opened 10 months ago by cqi.
cqi/fm-orchestrator fix-tests  into  master

@@ -57,7 +57,11 @@ 

          resolver = mbs_resolver.GenericResolver.create(tests.conf, backend='mbs')

          module_mmds = resolver.get_module_modulemds('testmodule', 'master', '20180205135154',

                                                      '9c690d0e')

-         nsvcs = set(m.dup_nsvc() for m in module_mmds)

+         nsvcs = set(

+             '{}:{}:{}:{}'.format(m.peek_name(), m.peek_stream(),

+                                  m.peek_version(), m.peek_context())

+             for m in module_mmds

+         )

          expected = set(["testmodule:master:20180205135154:9c690d0e"])

          mbs_url = tests.conf.mbs_url

          expected_query = {

@@ -106,7 +110,11 @@ 

          mock_session().get.return_value = mock_res

          resolver = mbs_resolver.GenericResolver.create(tests.conf, backend='mbs')

          ret = resolver.get_module_modulemds('testmodule', 'master', version)

-         nsvcs = set(m.dup_nsvc() for m in ret)

+         nsvcs = set(

+             '{}:{}:{}:{}'.format(m.peek_name(), m.peek_stream(),

+                                  m.peek_version(), m.peek_context())

+             for m in ret

+         )

          expected = set(["testmodule:master:20180205135154:9c690d0e",

                          "testmodule:master:20180205135154:c2c572ed"])

          mbs_url = tests.conf.mbs_url

dup_nsvc prints version in hexadecimal instead of integer. This is found
in libmodulemd 1.6.2 f28 build. This bug has been fixed in upstream but
not release yet. Before the release, this patch formats NSVC manually to
workaround it.

Signed-off-by: Chenxiong Qi cqi@redhat.com

Commit e180ad8 fixes this pull-request

Pull-Request has been merged by mprahl

10 months ago

Pull-Request has been merged by mprahl

10 months ago