diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-02-18 13:30:51 +0000 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-02-18 13:30:51 +0000 |
commit | 589ced475c9e200d4645f0b06f7846dae412b194 (patch) | |
tree | 2670497ceaaecf2e943d691b0ccf2f916beebb07 /tests/unittests/test_datasource/test_azure.py | |
parent | d47a6e5bf47287c50932812a5b64f763b8abcbe9 (diff) | |
download | vyos-cloud-init-589ced475c9e200d4645f0b06f7846dae412b194.tar.gz vyos-cloud-init-589ced475c9e200d4645f0b06f7846dae412b194.zip |
Read ovf-env.xml as bytes.
This should fix the Azure data source on Python 3, and is appropriate as
XML shouldn't really be read as a string.
Diffstat (limited to 'tests/unittests/test_datasource/test_azure.py')
-rw-r--r-- | tests/unittests/test_datasource/test_azure.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_azure.py b/tests/unittests/test_datasource/test_azure.py index 965bce4b..38d70fcd 100644 --- a/tests/unittests/test_datasource/test_azure.py +++ b/tests/unittests/test_datasource/test_azure.py @@ -360,6 +360,12 @@ class TestAzureDataSource(TestCase): self.assertTrue(os.path.exists(ovf_env_path)) self.assertEqual(xml, load_file(ovf_env_path)) + def test_ovf_can_include_unicode(self): + xml = construct_valid_ovf_env(data={}) + xml = u'\ufeff{0}'.format(xml) + dsrc = self._get_ds({'ovfcontent': xml}) + dsrc.get_data() + def test_existing_ovf_same(self): # waagent/SharedConfig left alone if found ovf-env.xml same as cached odata = {'UserData': b64e("SOMEUSERDATA")} |