Merge lp:~laney/ubuntu-cdimage/fix-tests into lp:ubuntu-cdimage

Proposed by Iain Lane
Status: Merged
Merged at revision: 1933
Proposed branch: lp:~laney/ubuntu-cdimage/fix-tests
Merge into: lp:ubuntu-cdimage
Prerequisite: lp:~laney/ubuntu-cdimage/stop-sync-mirrors
Diff against target: 95 lines (+15/-6)
4 files modified
lib/cdimage/livefs.py (+2/-1)
lib/cdimage/tests/test_mirror.py (+2/-1)
lib/cdimage/tests/test_static.py (+1/-1)
lib/cdimage/tests/test_tree.py (+10/-3)
To merge this branch: bzr merge lp:~laney/ubuntu-cdimage/fix-tests
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Ɓukasz Zemczak Pending
Review via email: mp+398107@code.launchpad.net

Description of the change

Fix torrent tests, then fix up pep8/pyflakes tests.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

Now ./run-tests works, for me at least!

Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/cdimage/livefs.py'
--- lib/cdimage/livefs.py 2021-01-11 16:22:59 +0000
+++ lib/cdimage/livefs.py 2021-02-16 11:34:00 +0000
@@ -83,7 +83,8 @@
83 # boards, thus specify subarch for livefs build. However, we83 # boards, thus specify subarch for livefs build. However, we
84 # don't want +subarch in the published image names. Hence84 # don't want +subarch in the published image names. Hence
85 # default-arches does not specify anything.85 # default-arches does not specify anything.
86 # TODO add support to specify the above via image_format metadata_override.86 # TODO add support to specify the above via image_format
87 # metadata_override.
87 subarch = "hifive"88 subarch = "hifive"
8889
89 return cpuarch, subarch90 return cpuarch, subarch
9091
=== modified file 'lib/cdimage/tests/test_mirror.py'
--- lib/cdimage/tests/test_mirror.py 2021-02-16 11:34:00 +0000
+++ lib/cdimage/tests/test_mirror.py 2021-02-16 11:34:00 +0000
@@ -229,6 +229,7 @@
229 def test_no_trigger_mirrors_when_stopped(self, mock_trigger_mirror):229 def test_no_trigger_mirrors_when_stopped(self, mock_trigger_mirror):
230 self.configure_triggers()230 self.configure_triggers()
231 os.mkdir(os.path.join(self.config.root, "etc"))231 os.mkdir(os.path.join(self.config.root, "etc"))
232 with open(os.path.join(self.config.root, "etc", "STOP_SYNC_MIRRORS"), "w"):232 with open(os.path.join(self.config.root, "etc", "STOP_SYNC_MIRRORS"),
233 "w"):
233 trigger_mirrors(self.config)234 trigger_mirrors(self.config)
234 mock_trigger_mirror.assert_not_called()235 mock_trigger_mirror.assert_not_called()
235236
=== modified file 'lib/cdimage/tests/test_static.py'
--- lib/cdimage/tests/test_static.py 2015-10-26 11:06:11 +0000
+++ lib/cdimage/tests/test_static.py 2021-02-16 11:34:00 +0000
@@ -92,7 +92,7 @@
92 if line.startswith("#"):92 if line.startswith("#"):
93 continue93 continue
94 line = line.rstrip()94 line = line.rstrip()
95 canon_line = re.sub(r":[0-9]+:", ":*:", line, 1)95 canon_line = re.sub(r":[0-9]+:(?:[0-9]+)?", ":*:", line, 1)
96 canon_line = re.sub(r"line [0-9]+", "line *", canon_line)96 canon_line = re.sub(r"line [0-9]+", "line *", canon_line)
97 if canon_line not in exclusions:97 if canon_line not in exclusions:
98 print(line)98 print(line)
9999
=== modified file 'lib/cdimage/tests/test_tree.py'
--- lib/cdimage/tests/test_tree.py 2020-12-10 17:32:42 +0000
+++ lib/cdimage/tests/test_tree.py 2021-02-16 11:34:00 +0000
@@ -2505,9 +2505,11 @@
2505 command_base = [2505 command_base = [
2506 "mktorrent", "-a", "https://torrent.ubuntu.com/announce",2506 "mktorrent", "-a", "https://torrent.ubuntu.com/announce",
2507 "--comment", "Ubuntu CD cdimage.ubuntu.com",2507 "--comment", "Ubuntu CD cdimage.ubuntu.com",
2508 "--output",
2508 ]2509 ]
2509 mock_check_call.assert_has_calls([2510 mock_check_call.assert_has_calls([
2510 mock.call(command_base + [path], stdout=mock.ANY)2511 mock.call(command_base + ["%s.torrent" % path, path],
2512 stdout=mock.ANY)
2511 for path in paths])2513 for path in paths])
25122514
2513 def test_publish_release_prefixes(self):2515 def test_publish_release_prefixes(self):
@@ -2570,6 +2572,7 @@
2570 mock.call([2572 mock.call([
2571 "mktorrent", mock.ANY, mock.ANY,2573 "mktorrent", mock.ANY, mock.ANY,
2572 "--comment", "Ubuntu CD cdimage.ubuntu.com",2574 "--comment", "Ubuntu CD cdimage.ubuntu.com",
2575 "--output", "%s.iso.torrent" % target_base,
2573 "%s.iso" % target_base,2576 "%s.iso" % target_base,
2574 ], stdout=mock.ANY),2577 ], stdout=mock.ANY),
2575 ])2578 ])
@@ -2621,6 +2624,7 @@
2621 mock_call.assert_called_once_with([2624 mock_call.assert_called_once_with([
2622 "mktorrent", mock.ANY, mock.ANY,2625 "mktorrent", mock.ANY, mock.ANY,
2623 "--comment", "Ubuntu CD cdimage.ubuntu.com",2626 "--comment", "Ubuntu CD cdimage.ubuntu.com",
2627 "--output", "%s.iso.torrent" % target_base,
2624 "%s.iso" % target_base,2628 "%s.iso" % target_base,
2625 ], stdout=mock.ANY)2629 ], stdout=mock.ANY)
2626 self.assertCountEqual([2630 self.assertCountEqual([
@@ -2796,9 +2800,11 @@
2796 "-a", "https://torrent.ubuntu.com/announce",2800 "-a", "https://torrent.ubuntu.com/announce",
2797 "-a", "https://ipv6.torrent.ubuntu.com/announce",2801 "-a", "https://ipv6.torrent.ubuntu.com/announce",
2798 "--comment", "Ubuntu CD releases.ubuntu.com",2802 "--comment", "Ubuntu CD releases.ubuntu.com",
2803 "--output",
2799 ]2804 ]
2800 mock_check_call.assert_has_calls([2805 mock_check_call.assert_has_calls([
2801 mock.call(command_base + [path], stdout=mock.ANY)2806 mock.call(command_base + ["%s.torrent" % path, path],
2807 stdout=mock.ANY)
2802 for path in paths])2808 for path in paths])
28032809
2804 def test_publish_release_prefixes(self):2810 def test_publish_release_prefixes(self):
@@ -2876,7 +2882,8 @@
2876 "-a", mock.ANY,2882 "-a", mock.ANY,
2877 "-a", mock.ANY,2883 "-a", mock.ANY,
2878 "--comment", "Ubuntu CD releases.ubuntu.com",2884 "--comment", "Ubuntu CD releases.ubuntu.com",
2879 "%s.iso" % target_base,2885 "--output", "%s.iso.torrent" % target_base,
2886 "%s.iso" % target_base
2880 ], stdout=mock.ANY),2887 ], stdout=mock.ANY),
2881 ])2888 ])
2882 self.assertCountEqual([2889 self.assertCountEqual([

Subscribers

People subscribed via source and target branches