コード例 #1
0
 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)
コード例 #2
0
 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)