Merge lp:~jtv/maas/import-boot-images-with-mandatory-sources into lp:~maas-committers/maas/trunk

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 2367
Proposed branch: lp:~jtv/maas/import-boot-images-with-mandatory-sources
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 44 lines (+5/-5)
1 file modified
src/provisioningserver/tests/test_tasks.py (+5/-5)
To merge this branch: bzr merge lp:~jtv/maas/import-boot-images-with-mandatory-sources
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve
Review via email: mp+220993@code.launchpad.net

This proposal supersedes a proposal from 2014-05-26.

Commit message

Prepare tests for import_boot_images task taking a mandatory sources argument. Extracted from larger branch to reduce review size.

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

No point waiting for this, really; it's a tiny change and tests would break if it were wrong. Self-approving.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/tests/test_tasks.py'
2--- src/provisioningserver/tests/test_tasks.py 2014-05-26 13:19:43 +0000
3+++ src/provisioningserver/tests/test_tasks.py 2014-05-26 16:17:24 +0000
4@@ -646,21 +646,21 @@
5 self.patch(boot_resources, 'logger')
6 self.patch(boot_resources, 'locate_config').return_value = (
7 fixture.filename)
8- import_boot_images()
9+ import_boot_images(sources=[])
10 self.assertIsInstance(import_boot_images, Task)
11
12 def test_import_boot_images_sets_GPGHOME(self):
13 home = factory.make_name('home')
14 self.patch(tasks, 'MAAS_USER_GPGHOME', home)
15 fake = self.patch_boot_resources_function()
16- import_boot_images()
17+ import_boot_images(sources=[])
18 self.assertEqual(home, fake.env['GNUPGHOME'])
19
20 def test_import_boot_images_sets_proxy_if_given(self):
21 proxy = 'http://%s.example.com' % factory.make_name('proxy')
22 proxy_vars = ['http_proxy', 'https_proxy']
23 fake = self.patch_boot_resources_function()
24- import_boot_images(http_proxy=proxy)
25+ import_boot_images(sources=[], http_proxy=proxy)
26 self.assertEqual(
27 {
28 var: proxy
29@@ -670,13 +670,13 @@
30 def test_import_boot_images_leaves_proxy_unchanged_if_not_given(self):
31 proxy_vars = ['http_proxy', 'https_proxy']
32 fake = self.patch_boot_resources_function()
33- import_boot_images()
34+ import_boot_images(sources=[])
35 self.assertEqual({}, utils.filter_dict(fake.env, proxy_vars))
36
37 def test_import_boot_images_calls_callback(self):
38 self.patch_boot_resources_function()
39 mock_callback = Mock()
40- import_boot_images(callback=mock_callback)
41+ import_boot_images(sources=[], callback=mock_callback)
42 self.assertThat(mock_callback.delay, MockCalledOnceWith())
43
44 def test_import_boot_images_accepts_sources_parameter(self):