summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_datasource/test_common.py')
-rw-r--r--tests/unittests/test_datasource/test_common.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_common.py b/tests/unittests/test_datasource/test_common.py
index 6b01a4ea..2a9cfb29 100644
--- a/tests/unittests/test_datasource/test_common.py
+++ b/tests/unittests/test_datasource/test_common.py
@@ -83,4 +83,15 @@ class ExpectedDataSources(test_helpers.TestCase):
self.assertEqual(set([AliYun.DataSourceAliYun]), set(found))
+class TestDataSourceInvariants(test_helpers.TestCase):
+
+ def test_data_sources_have_valid_network_config_sources(self):
+ for ds in DEFAULT_LOCAL + DEFAULT_NETWORK:
+ for cfg_src in ds.network_config_sources:
+ fail_msg = ('{} has an invalid network_config_sources entry:'
+ ' {}'.format(str(ds), cfg_src))
+ self.assertTrue(hasattr(sources.NetworkConfigSource, cfg_src),
+ fail_msg)
+
+
# vi: ts=4 expandtab