fix tests
This commit is contained in:
parent
556dddc9d0
commit
e6e618d0bb
136 changed files with 698 additions and 699 deletions
|
|
@ -10,7 +10,7 @@ import kojihub
|
|||
|
||||
class TestGetRPMFile(unittest.TestCase):
|
||||
|
||||
@mock.patch('kojihub.get_rpm')
|
||||
@mock.patch('kojihub.kojihub.get_rpm')
|
||||
def test_getRPMFile_no_rpminfo(self, get_rpm):
|
||||
def mock_get_rpm(rpmID, strict=False):
|
||||
if strict:
|
||||
|
|
@ -25,7 +25,7 @@ class TestGetRPMFile(unittest.TestCase):
|
|||
kojihub.RootExports().getRPMFile(1, 'filename', strict=True)
|
||||
self.assertEqual(cm.exception.args[0], 'msg')
|
||||
|
||||
@mock.patch('kojihub.get_rpm', return_value={'id': 1, 'build_id': None})
|
||||
@mock.patch('kojihub.kojihub.get_rpm', return_value={'id': 1, 'build_id': None})
|
||||
def test_getRPMFile_external_rpm(self, get_rpm):
|
||||
re = kojihub.RootExports().getRPMFile(1, 'filename')
|
||||
self.assertEqual(re, {})
|
||||
|
|
@ -34,8 +34,8 @@ class TestGetRPMFile(unittest.TestCase):
|
|||
self.assertEqual(cm.exception.args[0],
|
||||
'Can not get RPM file, because RPM: 1 is not internal')
|
||||
|
||||
@mock.patch('kojihub.get_rpm', return_value={'id': 1, 'build_id': 1})
|
||||
@mock.patch('kojihub.get_build', return_value={'id': 1})
|
||||
@mock.patch('kojihub.kojihub.get_rpm', return_value={'id': 1, 'build_id': 1})
|
||||
@mock.patch('kojihub.kojihub.get_build', return_value={'id': 1})
|
||||
@mock.patch('koji.pathinfo.build', return_value='fakebuildpath')
|
||||
@mock.patch('koji.pathinfo.rpm', return_value='fakerpmrelpath')
|
||||
@mock.patch('os.path.exists', return_value=False)
|
||||
|
|
@ -46,8 +46,8 @@ class TestGetRPMFile(unittest.TestCase):
|
|||
kojihub.RootExports().getRPMFile(1, 'filename', strict=True)
|
||||
self.assertEqual(cm.exception.args[0], "RPM package file of 1 doesn't exist")
|
||||
|
||||
@mock.patch('kojihub.get_rpm', return_value={'id': 1, 'build_id': 1})
|
||||
@mock.patch('kojihub.get_build')
|
||||
@mock.patch('kojihub.kojihub.get_rpm', return_value={'id': 1, 'build_id': 1})
|
||||
@mock.patch('kojihub.kojihub.get_build')
|
||||
@mock.patch('koji.pathinfo')
|
||||
def test_getRPMFile(self, pi, build, rpm):
|
||||
pi.build.return_value = os.path.join(os.path.dirname(__file__),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue