Ejemplo n.º 1
0
 def test__output(self):
     self.assertEquals(self.output, smartctl.run_storcli(self.args, True))
     self.assertThat(
         self.mock_check_output,
         MockCalledOnceWith(['sudo', '-n', 'storcli64'] + self.args,
                            timeout=smartctl.TIMEOUT))
     self.assertThat(self.mock_print, MockCalledOnce())
Ejemplo n.º 2
0
 def test__using_alt_path(self):
     self.patch(smartctl.os.path, 'exists').retrun_value = True
     self.assertEquals(self.output, smartctl.run_storcli(self.args))
     self.assertThat(
         self.mock_check_output,
         MockCalledOnceWith(
             ['sudo', '-n', '/opt/MegaRAID/storcli/storcli64'] + self.args,
             timeout=smartctl.TIMEOUT))
     self.assertThat(self.mock_print, MockNotCalled())
Ejemplo n.º 3
0
 def test_default(self):
     self.assertEquals(self.output, smartctl.run_storcli(self.args))
     self.assertThat(
         self.mock_check_output,
         MockCalledOnceWith(
             ["sudo", "-n", "storcli64"] + self.args,
             timeout=smartctl.TIMEOUT,
         ),
     )
     self.assertThat(self.mock_print, MockNotCalled())
Ejemplo n.º 4
0
 def test_using_alt_path(self):
     self.patch(smartctl.os.path, "exists").return_value = True
     self.assertEquals(self.output, smartctl.run_storcli(self.args))
     self.assertThat(
         self.mock_check_output,
         MockCalledOnceWith(
             ["sudo", "-n", "/opt/MegaRAID/storcli/storcli64"] + self.args,
             timeout=smartctl.TIMEOUT,
         ),
     )
     self.assertThat(self.mock_print, MockNotCalled())