def test_no_missing_packages(self): driver = nova_module.NovaPowerDriver() mock = self.patch(driver, "try_novaapi_import") mock.return_value = True missing = driver.detect_missing_packages() self.assertItemsEqual([], missing)
def test_missing_packages(self): driver = nova_module.NovaPowerDriver() mock = self.patch(driver, 'try_novaapi_import') mock.return_value = False missing = driver.detect_missing_packages() self.assertItemsEqual(['python3-novaclient'], missing)