- Unittests are fixed

This commit is contained in:
soksanichenko 2022-11-07 20:15:37 +02:00
parent ede91bcd03
commit ff946d3f7b

View File

@ -879,20 +879,14 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
def test_adding_module(self): def test_adding_module(self):
variant = mock.Mock(arches=[ variant = mock.Mock(arches=[
# "armhfp",
"x86_64" "x86_64"
], arch_mmds={}, modules=[]) ], arch_mmds={}, modules=[])
source_koji._add_module_to_variant(self.koji, variant, self.buildinfo) source_kojimock._add_module_to_variant(self.koji, variant, self.buildinfo)
self.assertEqual( self.assertEqual(
variant.arch_mmds, variant.arch_mmds,
{ {
# "armhfp": {
# "module:master:20190318:abcdef": MockModule(
# "/mnt/koji/modules/armv7hl/module:master-20190318-abcdef"
# ),
# },
"x86_64": { "x86_64": {
"module:master:20190318:abcdef": MockModule( "module:master:20190318:abcdef": MockModule(
"/mnt/koji/modules/fake_arch/module:master-20190318-abcdef" "/mnt/koji/modules/fake_arch/module:master-20190318-abcdef"
@ -905,7 +899,6 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
def test_adding_module_to_existing(self): def test_adding_module_to_existing(self):
variant = mock.Mock( variant = mock.Mock(
arches=[ arches=[
# "armhfp",
"x86_64" "x86_64"
], ],
arch_mmds={ arch_mmds={
@ -914,16 +907,11 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
modules=[{"name": "m1:latest-20190101:cafe", "glob": False}], modules=[{"name": "m1:latest-20190101:cafe", "glob": False}],
) )
source_koji._add_module_to_variant(self.koji, variant, self.buildinfo) source_kojimock._add_module_to_variant(self.koji, variant, self.buildinfo)
self.assertEqual( self.assertEqual(
variant.arch_mmds, variant.arch_mmds,
{ {
# "armhfp": {
# "module:master:20190318:abcdef": MockModule(
# "/mnt/koji/modules/armv7hl/module:master-20190318-abcdef"
# ),
# },
"x86_64": { "x86_64": {
"module:master:20190318:abcdef": MockModule( "module:master:20190318:abcdef": MockModule(
"/mnt/koji/modules/fake_arch/module:master-20190318-abcdef" "/mnt/koji/modules/fake_arch/module:master-20190318-abcdef"
@ -938,22 +926,16 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
def test_adding_module_with_add_module(self): def test_adding_module_with_add_module(self):
variant = mock.Mock(arches=[ variant = mock.Mock(arches=[
# "armhfp",
"x86_64" "x86_64"
], arch_mmds={}, modules=[]) ], arch_mmds={}, modules=[])
source_koji._add_module_to_variant( source_kojimock._add_module_to_variant(
self.koji, variant, self.buildinfo, add_to_variant_modules=True self.koji, variant, self.buildinfo, add_to_variant_modules=True
) )
self.assertEqual( self.assertEqual(
variant.arch_mmds, variant.arch_mmds,
{ {
# "armhfp": {
# "module:master:20190318:abcdef": MockModule(
# "/mnt/koji/modules/module:master-20190318-abcdef"
# ),
# },
"x86_64": { "x86_64": {
"module:master:20190318:abcdef": MockModule( "module:master:20190318:abcdef": MockModule(
"/mnt/koji/modules/fake_arch/module:master-20190318-abcdef" "/mnt/koji/modules/fake_arch/module:master-20190318-abcdef"
@ -968,7 +950,6 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
def test_adding_module_to_existing_with_add_module(self): def test_adding_module_to_existing_with_add_module(self):
variant = mock.Mock( variant = mock.Mock(
arches=[ arches=[
# "armhfp",
"x86_64" "x86_64"
], ],
arch_mmds={ arch_mmds={
@ -977,18 +958,13 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
modules=[{"name": "m1:latest-20190101:cafe", "glob": False}], modules=[{"name": "m1:latest-20190101:cafe", "glob": False}],
) )
source_koji._add_module_to_variant( source_kojimock._add_module_to_variant(
self.koji, variant, self.buildinfo, add_to_variant_modules=True self.koji, variant, self.buildinfo, add_to_variant_modules=True
) )
self.assertEqual( self.assertEqual(
variant.arch_mmds, variant.arch_mmds,
{ {
# "armhfp": {
# "module:master:20190318:abcdef": MockModule(
# "/koji/modulemd.armv7hl.txt"
# ),
# },
"x86_64": { "x86_64": {
"module:master:20190318:abcdef": MockModule( "module:master:20190318:abcdef": MockModule(
"/mnt/koji/modules/fake_arch/module:master-20190318-abcdef" "/mnt/koji/modules/fake_arch/module:master-20190318-abcdef"
@ -1011,12 +987,11 @@ class TestAddModuleToVariantForKojiMock(helpers.PungiTestCase):
) )
variant = mock.Mock( variant = mock.Mock(
arches=[ arches=[
# "armhfp",
"x86_64" "x86_64"
], arch_mmds={}, modules=[], uid="Variant" ], arch_mmds={}, modules=[], uid="Variant"
) )
nsvc = source_koji._add_module_to_variant( nsvc = source_kojimock._add_module_to_variant(
self.koji, self.koji,
variant, variant,
self.buildinfo, self.buildinfo,