diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-05-23 16:14:04 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-05-23 16:14:04 +0200 |
commit | 23a19bde96d895e97c5fb6dbbe50620fb1130553 (patch) | |
tree | d077a14b959af85b0b85eb647d8cae6ca1c0c446 /tests/unittests | |
parent | 299e3dd9b3769101fa694d7e96895bb89e0375ca (diff) | |
download | vyos-cloud-init-23a19bde96d895e97c5fb6dbbe50620fb1130553.tar.gz vyos-cloud-init-23a19bde96d895e97c5fb6dbbe50620fb1130553.zip |
add test_apt_src_replace_dict_tri
This includes a test for the weird but valid case in the new dictionary syntax
that one sets a key (which is the filename) but overwrites the filename value
inside of it.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_handler/test_handler_apt_source.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_source.py b/tests/unittests/test_handler/test_handler_apt_source.py index 9a2cc268..237cf14d 100644 --- a/tests/unittests/test_handler/test_handler_apt_source.py +++ b/tests/unittests/test_handler/test_handler_apt_source.py @@ -246,6 +246,20 @@ class TestAptSourceConfig(TestCase): 'filename': self.aptlistfile3} self.apt_src_replace_tri([cfg1, cfg2, cfg3]) + def test_apt_src_replace_dict_tri(self): + """ test_apt_src_replace_dict_tri + Test three autoreplacements of MIRROR and RELEASE in source specs with + Filename being set + Provided in a dictionary with filename being the key (new format) + We also test a new special conditions of the new format that allows + filenames to be overwritten inside the directory entry. + """ + cfg = {self.aptlistfile: {'source': 'deb $MIRROR $RELEASE multiverse'}, + 'notused': {'source': 'deb $MIRROR $RELEASE main', + 'filename': self.aptlistfile2}, + self.aptlistfile3: {'source': 'deb $MIRROR $RELEASE universe'}} + self.apt_src_replace_tri(cfg) + def test_apt_src_replace_nofn(self): """ test_apt_src_replace_nofn Test Autoreplacement of MIRROR and RELEASE in source specs with |