diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-06-21 10:19:59 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-06-21 10:19:59 -0400 |
commit | f21f3e262493b9f2f07710e51e7f0247e5132a22 (patch) | |
tree | 1fedaa8aabb8c572a9b82f417f9ede23ed12debc /tests/unittests | |
parent | 9c006ca13981dcfb01324dbadacda741d5610401 (diff) | |
download | vyos-cloud-init-f21f3e262493b9f2f07710e51e7f0247e5132a22.tar.gz vyos-cloud-init-f21f3e262493b9f2f07710e51e7f0247e5132a22.zip |
commit test changes
cleaned up tests a bit. still they raise exception, but print out
the files rendered and all use the _render_and_read helper.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_net.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py index a9268d30..ecd21b2b 100644 --- a/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py @@ -505,29 +505,24 @@ class TestEniRoundTrip(TestCase): 'netrules_path': netrules_path}) renderer.render_network_state(self.tmp_dir, ns) + for f, c in dir2dict(self.tmp_dir).items(): + print("=== %s ===" % f) + print(c) return dir2dict(self.tmp_dir) def testsimple_convert_and_render(self): network_config = eni.convert_eni_data(EXAMPLE_ENI) - ns = network_state.parse_net_config_data(network_config) - eni_path = 'etc/network/interfaces.d/my.interfaces' - eni_full_path = os.path.join(self.tmp_dir, eni_path) - renderer = eni.Renderer(config={'eni_path': eni_path}) - renderer.render_network_state(self.tmp_dir, ns) - eni_content = util.load_file(eni_full_path) - print("Eni looks like: %s" % eni_content) + files = self._render_and_read(network_config=network_config) raise Exception("FOO1") def testsimple_render_all(self): - files = self._render_and_read(network_config=yaml.load(NETWORK_YAML_ALL)) - print("files: %s" % files) + files = self._render_and_read( + network_config=yaml.load(NETWORK_YAML_ALL)) raise Exception("FOO2") def skiptestsimple_render_small(self): - network_config = yaml.load(NETWORK_YAML_SMALL) - ns = network_state.parse_net_config_data(network_config) - eni = net.render_interfaces(ns) - print("Eni looks like:\n%s" % eni) + files = self._render_and_read( + network_config=yaml.load(NETWORK_YAML_SMALL)) raise Exception("FOO3") |