Ejemplo n.º 1
0
 def test_power_off(self):
     driver = manual_module.ManualPowerDriver()
     mock = self.patch(manual_module.maaslog, 'info')
     driver.power_off("fake_id", {})
     self.assertThat(
         mock,
         MockCalledOnceWith("You need to power off %s manually." %
                            "fake_id"))
Ejemplo n.º 2
0
 def test_power_query(self):
     driver = manual_module.ManualPowerDriver()
     mock = self.patch(manual_module.maaslog, 'info')
     power_state = driver.power_query("fake_id", {})
     self.assertEqual(power_state, 'unknown')
     self.assertThat(
         mock,
         MockCalledOnceWith(
             "You need to check power state of %s manually." % "fake_id"))
Ejemplo n.º 3
0
 def test_no_missing_packages(self):
     driver = manual_module.ManualPowerDriver()
     missing = driver.detect_missing_packages()
     self.assertItemsEqual([], missing)