コード例 #1
0
 def test_should_load_on_ubuntu_no_python3_apt(self, _):
     with patch.dict("sys.modules", apt=None):
         apt = AptBundleInstallerExtension()
         with self.assertRaises(RuntimeError): apt.should_load()
コード例 #2
0
 def test_should_load_on_ubuntu(self, _):
     with patch.dict("sys.modules", apt=mock.MagicMock()):
         apt = AptBundleInstallerExtension()
         assert apt.should_load() == True
コード例 #3
0
 def test_should_load_on_ubuntu_no_python3_apt(self, _):
     sys.modules['apt'] = None
     apt = AptBundleInstallerExtension()
     with self.assertRaises(RuntimeError): apt.should_load()
コード例 #4
0
 def test_should_load_not_on_ubuntu(self, get_version):
     apt = AptBundleInstallerExtension()
     get_version.side_effect = ValueError()
     assert apt.should_load() == False
コード例 #5
0
 def test_should_load_on_ubuntu(self, _):
     sys.modules['apt'] = mock.MagicMock()
     apt = AptBundleInstallerExtension()
     assert apt.should_load() == True