From d82f6c1ecd255ed3a76bd8ef7b76163408f0b398 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 11 May 2016 16:55:37 +0200 Subject: add test_apt_source_keyonly (not yet supported) --- tests/unittests/test_handler/test_handler_apt_source.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/unittests/test_handler') 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 -- cgit v1.2.3