diff options
author | Chad Smith <chad.smith@canonical.com> | 2018-02-02 11:11:36 -0700 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-02-02 11:11:36 -0700 |
commit | 78013bc65030421699b5feb66bc8b7a205abfbc0 (patch) | |
tree | 2ebf7111129f4aaf8a833ba6d226d4513ed59388 /tests/unittests/test_datasource/test_scaleway.py | |
parent | 192261fe38a32edbd1f605ba25bbb6f4822a0720 (diff) | |
parent | f7deaf15acf382d62554e2b1d70daa9a9109d542 (diff) | |
download | vyos-cloud-init-78013bc65030421699b5feb66bc8b7a205abfbc0.tar.gz vyos-cloud-init-78013bc65030421699b5feb66bc8b7a205abfbc0.zip |
merge from master at 17.2-30-gf7deaf15
Diffstat (limited to 'tests/unittests/test_datasource/test_scaleway.py')
-rw-r--r-- | tests/unittests/test_datasource/test_scaleway.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/unittests/test_datasource/test_scaleway.py b/tests/unittests/test_datasource/test_scaleway.py index 436df9ee..8dec06b1 100644 --- a/tests/unittests/test_datasource/test_scaleway.py +++ b/tests/unittests/test_datasource/test_scaleway.py @@ -9,7 +9,7 @@ from cloudinit import helpers from cloudinit import settings from cloudinit.sources import DataSourceScaleway -from cloudinit.tests.helpers import mock, HttprettyTestCase, TestCase +from cloudinit.tests.helpers import mock, HttprettyTestCase, CiTestCase class DataResponses(object): @@ -63,7 +63,11 @@ class MetadataResponses(object): return 200, headers, json.dumps(cls.FAKE_METADATA) -class TestOnScaleway(TestCase): +class TestOnScaleway(CiTestCase): + + def setUp(self): + super(TestOnScaleway, self).setUp() + self.tmp = self.tmp_dir() def install_mocks(self, fake_dmi, fake_file_exists, fake_cmdline): mock, faked = fake_dmi @@ -91,7 +95,7 @@ class TestOnScaleway(TestCase): # When not on Scaleway, get_data() returns False. datasource = DataSourceScaleway.DataSourceScaleway( - settings.CFG_BUILTIN, None, helpers.Paths({}) + settings.CFG_BUILTIN, None, helpers.Paths({'run_dir': self.tmp}) ) self.assertFalse(datasource.get_data()) @@ -159,8 +163,9 @@ def get_source_address_adapter(*args, **kwargs): class TestDataSourceScaleway(HttprettyTestCase): def setUp(self): + tmp = self.tmp_dir() self.datasource = DataSourceScaleway.DataSourceScaleway( - settings.CFG_BUILTIN, None, helpers.Paths({}) + settings.CFG_BUILTIN, None, helpers.Paths({'run_dir': tmp}) ) super(TestDataSourceScaleway, self).setUp() |