diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-05-11 16:55:37 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-05-11 16:55:37 +0200 |
commit | d82f6c1ecd255ed3a76bd8ef7b76163408f0b398 (patch) | |
tree | f0703df67553ede31d7590b7a9d6e25b2f9df916 | |
parent | a9cd544d7de1af90f6c5cf9df43135b530acb308 (diff) | |
download | vyos-cloud-init-d82f6c1ecd255ed3a76bd8ef7b76163408f0b398.tar.gz vyos-cloud-init-d82f6c1ecd255ed3a76bd8ef7b76163408f0b398.zip |
add test_apt_source_keyonly (not yet supported)
-rw-r--r-- | tests/unittests/test_handler/test_handler_apt_source.py | 16 |
1 files changed, 16 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 a7db0fa6..92a92406 100644 --- a/tests/unittests/test_handler/test_handler_apt_source.py +++ b/tests/unittests/test_handler/test_handler_apt_source.py @@ -163,6 +163,22 @@ class TestAptSourceConfig(TestCase): "xenial", "main"), contents, flags=re.IGNORECASE)) + def test_apt_source_keyonly(self): + """ test_apt_source_keyonly + Test specification key without source (not yet supported) + """ + params = self._get_default_params() + cfg = {'key': "fakekey 4242", + 'filename': self.aptlistfile} + + with mock.patch.object(util, 'subp') as mockobj: + cc_apt_configure.add_sources([cfg], params) + + mockobj.assert_called_once_with(('apt-key', 'add', '-'), 'fakekey 4242') + + # filename should be ignored on key only + self.assertFalse(os.path.isfile(self.aptlistfile)) + def test_apt_source_ppa(self): """ test_apt_source_ppa Test specification of a ppa |