diff options
author | Joshua Harlow <harlowja@gmail.com> | 2016-06-10 14:16:51 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2016-06-10 14:16:51 -0700 |
commit | 6ada153ebfd9483d76f904dafaa1fc80f61c9205 (patch) | |
tree | 148f2f126032e0c8df83aabbfbe15246dd0cd973 /tests/unittests/test_datasource/test_configdrive.py | |
parent | 30f1a6be14635aadf7c0c0b7071ddf947563a1b3 (diff) | |
download | vyos-cloud-init-6ada153ebfd9483d76f904dafaa1fc80f61c9205.tar.gz vyos-cloud-init-6ada153ebfd9483d76f904dafaa1fc80f61c9205.zip |
Just mock 'on_first_boot' vs special argument
Diffstat (limited to 'tests/unittests/test_datasource/test_configdrive.py')
-rw-r--r-- | tests/unittests/test_datasource/test_configdrive.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py index b898e2bd..18551b92 100644 --- a/tests/unittests/test_datasource/test_configdrive.py +++ b/tests/unittests/test_datasource/test_configdrive.py @@ -370,7 +370,8 @@ class TestConfigDriveDataSource(TestCase): util.find_devs_with = orig_find_devs_with util.is_partition = orig_is_partition - def test_pubkeys_v2(self): + @mock.patch('cloudinit.sources.DataSourceConfigDrive.on_first_boot') + def test_pubkeys_v2(self, on_first_boot): """Verify that public-keys work in config-drive-v2.""" populate_dir(self.tmp, CFG_DRIVE_FILES_V2) myds = cfg_ds_from_dir(self.tmp) @@ -385,13 +386,15 @@ class TestNetJson(TestCase): self.addCleanup(shutil.rmtree, self.tmp) self.maxDiff = None - def test_network_data_is_found(self): + @mock.patch('cloudinit.sources.DataSourceConfigDrive.on_first_boot') + def test_network_data_is_found(self, on_first_boot): """Verify that network_data is present in ds in config-drive-v2.""" populate_dir(self.tmp, CFG_DRIVE_FILES_V2) myds = cfg_ds_from_dir(self.tmp) self.assertIsNotNone(myds.network_json) - def test_network_config_is_converted(self): + @mock.patch('cloudinit.sources.DataSourceConfigDrive.on_first_boot') + def test_network_config_is_converted(self, on_first_boot): """Verify that network_data is converted and present on ds object.""" populate_dir(self.tmp, CFG_DRIVE_FILES_V2) myds = cfg_ds_from_dir(self.tmp) @@ -558,7 +561,7 @@ def cfg_ds_from_dir(seed_d): helpers.Paths({})) cfg_ds.seed_dir = seed_d cfg_ds.known_macs = KNOWN_MACS.copy() - if not cfg_ds.get_data(skip_first_boot=True): + if not cfg_ds.get_data(): raise RuntimeError("Data source did not extract itself from" " seed directory %s" % seed_d) return cfg_ds |