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())
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())
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())
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())