From d5bc051cdc418efa0a910f8b61790523b89e8f91 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 11 May 2016 16:59:15 +0200 Subject: add test_apt_source_keyidonly (not yet supported) --- tests/unittests/test_handler/test_handler_apt_source.py | 17 +++++++++++++++++ 1 file changed, 17 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 091b07da..de009174 100644 --- a/tests/unittests/test_handler/test_handler_apt_source.py +++ b/tests/unittests/test_handler/test_handler_apt_source.py @@ -178,6 +178,23 @@ class TestAptSourceConfig(TestCase): # filename should be ignored on key only self.assertFalse(os.path.isfile(self.aptlistfile)) + def test_apt_source_keyidonly(self): + """ test_apt_source_keyidonly + Test specification of a keyid without source (not yet supported) + """ + params = self._get_default_params() + cfg = {'keyid': "03683F77", + 'filename': self.aptlistfile} + + with mock.patch.object(util, 'subp', + return_value=('fakekey 1212', '')) as mockobj: + cc_apt_configure.add_sources([cfg], params) + + mockobj.assert_called_with(('apt-key', 'add', '-'), 'fakekey 1212') + + # 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