-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vismay Golwala <[email protected]>
- Loading branch information
1 parent
7dda554
commit 44d46e3
Showing
4 changed files
with
45 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
|
||
from click import testing | ||
import mock | ||
from kitchen.text.converters import to_bytes | ||
import six | ||
import six.moves.urllib.parse as urlparse | ||
from six.moves.urllib.error import HTTPError, URLError | ||
|
@@ -555,7 +556,6 @@ def test_tag_ordering(self, publish, *args): | |
self.assertEqual(self.koji.__moved__[1], | ||
(u'f17-updates-candidate', u'f17-updates-testing', u'bodhi-2.0-2.fc17')) | ||
|
||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch(**mock_taskotron_results) | ||
@mock.patch('bodhi.server.consumers.masher.PungiComposerThread._wait_for_pungi') | ||
@mock.patch('bodhi.server.consumers.masher.PungiComposerThread._sanity_check_repo') | ||
|
@@ -595,11 +595,12 @@ def test_testing_digest(self, mail, *args): | |
""" % time.strftime('%Y')) | ||
|
||
mail.assert_called_with(config.get('bodhi_email'), config.get('fedora_test_announce_list'), | ||
mail.assert_called_with(to_bytes(config.get('bodhi_email')), | ||
to_bytes(config.get('fedora_test_announce_list')), | ||
mock.ANY) | ||
assert len(mail.mock_calls) == 2, len(mail.mock_calls) | ||
body = mail.mock_calls[1][1][2] | ||
assert body.startswith( | ||
assert body.decode('utf-8').startswith( | ||
('From: [email protected]\r\nTo: %s\r\nX-Bodhi: fedoraproject.org\r\nSubject: ' | ||
'Fedora 17 updates-testing report\r\n\r\nThe following builds have been pushed to ' | ||
'Fedora 17 updates-testing\n\n bodhi-2.0-1.fc17\n\nDetails about builds:\n\n\n=====' | ||
|
@@ -1042,7 +1043,6 @@ def test_security_update_priority_testing(self, publish, *args): | |
force=True, | ||
topic='mashtask.complete')) | ||
|
||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch(**mock_taskotron_results) | ||
@mock.patch('bodhi.server.consumers.masher.PungiComposerThread._wait_for_pungi') | ||
@mock.patch('bodhi.server.consumers.masher.PungiComposerThread._sanity_check_repo') | ||
|
@@ -1094,6 +1094,12 @@ def test_security_updates_parallel(self, publish, *args): | |
self.masher.consume(self._make_msg()) | ||
|
||
# Ensure that F18 and F17 run in parallel | ||
# If F17 is executed first, it will publish messages on 5 topics: | ||
# [ mashtask.mashing, buildroot_override.untag, update.complete.stable, | ||
# errata.publish, mashtask.complete ]. So, F18 mashing call is expected on calls[6]. | ||
# | ||
# On other hand if F18 is executed first, it will publish 4 of the above messages | ||
# except `buildroot_override.untag` and so, F17 call is expected on calls[5]. | ||
calls = publish.mock_calls | ||
if calls[1] == mock.call( | ||
msg={'repo': u'f18-updates', | ||
|
@@ -1102,25 +1108,24 @@ def test_security_updates_parallel(self, publish, *args): | |
'agent': 'bowlofeggs'}, | ||
force=True, topic='mashtask.mashing'): | ||
self.assertEqual( | ||
calls[2], | ||
calls[5], | ||
mock.call(msg={'repo': u'f17-updates', | ||
'ctype': 'rpm', | ||
'updates': [u'bodhi-2.0-1.fc17'], | ||
'agent': 'bowlofeggs'}, | ||
force=True, topic='mashtask.mashing')) | ||
elif calls[1] == self.assertEqual( | ||
calls[1], | ||
mock.call( | ||
msg={'repo': u'f17-updates', | ||
'ctype': 'rpm', | ||
'updates': [u'bodhi-2.0-1.fc17'], | ||
'agent': 'bowlofeggs'}, | ||
force=True, topic='mashtask.mashing')): | ||
elif calls[1] == mock.call( | ||
msg={'repo': u'f17-updates', | ||
'ctype': 'rpm', | ||
'updates': [u'bodhi-2.0-1.fc17'], | ||
'agent': 'bowlofeggs'}, | ||
force=True, topic='mashtask.mashing'): | ||
self.assertEqual( | ||
calls[2], | ||
calls[6], | ||
mock.call(msg={'repo': u'f18-updates', | ||
'ctype': 'rpm', | ||
'updates': [u'bodhi-2.0-1.fc18']}, | ||
'updates': [u'bodhi-2.0-1.fc18'], | ||
'agent': 'bowlofeggs'}, | ||
force=True, topic='mashtask.mashing')) | ||
|
||
@mock.patch('bodhi.server.notifications.publish') | ||
|
@@ -1306,7 +1311,6 @@ def test_mash(self, publish, *args): | |
'status_comments': True}) | ||
self.assertTrue(os.path.exists(mash_dir)) | ||
|
||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch(**mock_taskotron_results) | ||
@mock.patch('bodhi.server.consumers.masher.PungiComposerThread._sanity_check_repo') | ||
@mock.patch('bodhi.server.consumers.masher.PungiComposerThread._stage_repo') | ||
|
@@ -1366,10 +1370,10 @@ def test_mash_module(self, publish, *args): | |
force=True, | ||
msg=mock.ANY) | ||
|
||
self.assertEqual(t._module_defs, [{'context': '2', | ||
'version': '20172', | ||
'name': 'testmodule', | ||
'stream': 'master'}]) | ||
self.assertEqual(list(t._module_defs), [{'context': '2', | ||
'version': '20172', | ||
'name': 'testmodule', | ||
'stream': 'master'}]) | ||
self.assertEqual(t._module_list, ['testmodule:master:20172']) | ||
|
||
EXPECTED_VARIANTS = '''Raw NSVs: | ||
|
@@ -2723,7 +2727,6 @@ def test_without_state(self): | |
|
||
class TestPungiComposerThread__wait_for_sync(ComposerThreadBaseTestCase): | ||
"""This test class contains tests for the PungiComposerThread._wait_for_sync() method.""" | ||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch.dict( | ||
'bodhi.server.consumers.masher.config', | ||
{'fedora_testing_master_repomd': | ||
|
@@ -2797,7 +2800,6 @@ def test_no_checkarch(self, urlopen, publish): | |
except Exception as ex: | ||
assert str(ex) == "Not found an arch to _wait_for_sync with" | ||
|
||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch.dict( | ||
'bodhi.server.consumers.masher.config', | ||
{'fedora_testing_master_repomd': | ||
|
@@ -2841,7 +2843,6 @@ def test_checksum_match_third_try(self, urlopen, sleep, publish): | |
urlopen.assert_has_calls(expected_calls) | ||
sleep.assert_has_calls([mock.call(200), mock.call(200)]) | ||
|
||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch.dict( | ||
'bodhi.server.consumers.masher.config', | ||
{'fedora_testing_master_repomd': | ||
|
@@ -2945,7 +2946,6 @@ def test_missing_repomd(self, publish): | |
t.log.error.assert_called_once_with( | ||
'Cannot find local repomd: %s', os.path.join(repodata, 'repomd.xml')) | ||
|
||
@unittest.skipIf(six.PY3, 'Not working with Python 3 yet') | ||
@mock.patch.dict( | ||
'bodhi.server.consumers.masher.config', | ||
{'fedora_testing_master_repomd': | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters