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()
def test_should_load_on_ubuntu(self, _): with patch.dict("sys.modules", apt=mock.MagicMock()): apt = AptBundleInstallerExtension() assert apt.should_load() == True
def test_should_load_on_ubuntu_no_python3_apt(self, _): sys.modules['apt'] = None apt = AptBundleInstallerExtension() with self.assertRaises(RuntimeError): apt.should_load()
def test_should_load_not_on_ubuntu(self, get_version): apt = AptBundleInstallerExtension() get_version.side_effect = ValueError() assert apt.should_load() == False
def test_should_load_on_ubuntu(self, _): sys.modules['apt'] = mock.MagicMock() apt = AptBundleInstallerExtension() assert apt.should_load() == True