arch: Remove mocks in tests

This was added back when rpmutils module was used. Since we migrated to
Python 3 we have included the code directly in Pungi (because it was
coming from yum which is not going to Py3 any time soon). The mocks can
be dropped.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-05-09 13:10:37 +02:00
parent 7c237c2c63
commit 905064775a
1 changed files with 0 additions and 45 deletions

View File

@ -13,51 +13,6 @@ from pungi.arch import (get_compatible_arches, get_valid_arches, get_valid_multi
is_excluded, is_valid_arch, split_name_arch)
class MockArchModule(object):
"""
This is a class intended to be used as a replacement for rpmUtils.arch
module in following tests. The data is intentionally not complete.
"""
arches = {'i386': 'noarch',
'x86_64': 'athlon'}
@staticmethod
def getMultiArchInfo(yum_arch):
DATA = {
'athlon': None,
'x86_64': ('athlon', 'x86_64', 'athlon'),
'armv7hnl': None,
'noarch': None,
'ppc64p7': ('ppc', 'ppc64', 'ppc64'),
}
return DATA[yum_arch]
@staticmethod
def getArchList(yum_arch):
ARCHES = {
'athlon': ['athlon', 'i686', 'i586', 'i486', 'i386', 'noarch'],
'x86_64': ['x86_64', 'athlon', 'i686', 'i586', 'i486', 'i386', 'noarch'],
'armv7hnl': ['armv7hnl', 'armv7hl', 'armv6hl', 'noarch'],
'noarch': ['noarch'],
'ppc64p7': ['ppc64p7', 'ppc64', 'ppc', 'noarch'],
'ppc': ['ppc', 'noarch'],
}
return ARCHES[yum_arch]
@staticmethod
def getBaseArch(yum_arch):
ARCHES = {
'noarch': 'noarch',
'i386': 'i386',
'i586': 'i386',
'x86_64': 'x86_64',
'ppc64p7': 'ppc64',
'armhfp': 'armhfp',
}
return ARCHES[yum_arch]
@mock.patch('pungi.arch_utils', MockArchModule)
class TestArch(unittest.TestCase):
def test_i386(self):