Merge ~smoser/cloud-init:bug/1645916-cloudsigma-local-ds into cloud-init:master

Proposed by Scott Moser
Status: Merged
Merged at revision: a9d41de47a58d967ae3fd6a7749f8143a14424d3
Proposed branch: ~smoser/cloud-init:bug/1645916-cloudsigma-local-ds
Merge into: cloud-init:master
Diff against target: 43 lines (+16/-1)
2 files modified
cloudinit/sources/DataSourceCloudSigma.py (+1/-1)
tests/unittests/test_datasource/test_cloudsigma.py (+15/-0)
Reviewer Review Type Date Requested Status
Louis Bouchard (community) Approve
cloud-init Commiters Pending
Review via email: mp+312732@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

Should we update the unittest to test this listing for each of our Datasources?

Revision history for this message
Louis Bouchard (louis) wrote :

lgtm. Local tests show that list_sources() now return the proper value. I do agree that the tests would benefit to be done on all datasources

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/cloudinit/sources/DataSourceCloudSigma.py b/cloudinit/sources/DataSourceCloudSigma.py
index be74503..448e2a4 100644
--- a/cloudinit/sources/DataSourceCloudSigma.py
+++ b/cloudinit/sources/DataSourceCloudSigma.py
@@ -115,7 +115,7 @@ DataSourceCloudSigmaNet = DataSourceCloudSigma
115# Used to match classes to dependencies. Since this datasource uses the serial115# Used to match classes to dependencies. Since this datasource uses the serial
116# port network is not really required, so it's okay to load without it, too.116# port network is not really required, so it's okay to load without it, too.
117datasources = [117datasources = [
118 (DataSourceCloudSigma, (sources.DEP_FILESYSTEM)),118 (DataSourceCloudSigma, (sources.DEP_FILESYSTEM, )),
119]119]
120120
121121
diff --git a/tests/unittests/test_datasource/test_cloudsigma.py b/tests/unittests/test_datasource/test_cloudsigma.py
index 2a42ce0..a1d59c6 100644
--- a/tests/unittests/test_datasource/test_cloudsigma.py
+++ b/tests/unittests/test_datasource/test_cloudsigma.py
@@ -3,6 +3,7 @@
3import copy3import copy
44
5from cloudinit.cs_utils import Cepko5from cloudinit.cs_utils import Cepko
6from cloudinit import sources
6from cloudinit.sources import DataSourceCloudSigma7from cloudinit.sources import DataSourceCloudSigma
78
8from .. import helpers as test_helpers9from .. import helpers as test_helpers
@@ -97,3 +98,17 @@ class DataSourceCloudSigmaTest(test_helpers.TestCase):
97 self.datasource.get_data()98 self.datasource.get_data()
9899
99 self.assertIsNone(self.datasource.vendordata_raw)100 self.assertIsNone(self.datasource.vendordata_raw)
101
102
103class DsLoads(test_helpers.TestCase):
104 def test_get_datasource_list_returns_in_local(self):
105 deps = (sources.DEP_FILESYSTEM,)
106 ds_list = DataSourceCloudSigma.get_datasource_list(deps)
107 self.assertEqual(ds_list,
108 [DataSourceCloudSigma.DataSourceCloudSigma])
109
110 def test_list_sources_finds_ds(self):
111 found = sources.list_sources(
112 ['CloudSigma'], (sources.DEP_FILESYSTEM,), ['cloudinit.sources'])
113 self.assertEqual([DataSourceCloudSigma.DataSourceCloudSigma],
114 found)

Subscribers

People subscribed via source and target branches