mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 10:48:01 +02:00
Collection of tests improvements (#33778)
This commit is contained in:
@ -95,7 +95,7 @@ class TestShellCommand(unittest.TestCase):
|
||||
self.hass.block_till_done()
|
||||
cmd = mock_call.mock_calls[0][1][0]
|
||||
|
||||
assert 1 == mock_call.call_count
|
||||
assert mock_call.call_count == 1
|
||||
assert "ls /bin" == cmd
|
||||
|
||||
@patch(
|
||||
@ -121,7 +121,7 @@ class TestShellCommand(unittest.TestCase):
|
||||
self.hass.block_till_done()
|
||||
cmd = mock_call.mock_calls[0][1]
|
||||
|
||||
assert 1 == mock_call.call_count
|
||||
assert mock_call.call_count == 1
|
||||
assert ("ls", "/bin", "Works") == cmd
|
||||
|
||||
@patch(
|
||||
@ -143,8 +143,8 @@ class TestShellCommand(unittest.TestCase):
|
||||
self.hass.services.call("shell_command", "test_service", blocking=True)
|
||||
|
||||
self.hass.block_till_done()
|
||||
assert 1 == mock_call.call_count
|
||||
assert 1 == mock_error.call_count
|
||||
assert mock_call.call_count == 1
|
||||
assert mock_error.call_count == 1
|
||||
assert not os.path.isfile(path)
|
||||
|
||||
@patch("homeassistant.components.shell_command._LOGGER.debug")
|
||||
@ -160,7 +160,7 @@ class TestShellCommand(unittest.TestCase):
|
||||
self.hass.services.call("shell_command", "test_service", blocking=True)
|
||||
|
||||
self.hass.block_till_done()
|
||||
assert 1 == mock_output.call_count
|
||||
assert mock_output.call_count == 1
|
||||
assert test_phrase.encode() + b"\n" == mock_output.call_args_list[0][0][-1]
|
||||
|
||||
@patch("homeassistant.components.shell_command._LOGGER.debug")
|
||||
@ -176,5 +176,5 @@ class TestShellCommand(unittest.TestCase):
|
||||
self.hass.services.call("shell_command", "test_service", blocking=True)
|
||||
|
||||
self.hass.block_till_done()
|
||||
assert 1 == mock_output.call_count
|
||||
assert mock_output.call_count == 1
|
||||
assert test_phrase.encode() + b"\n" == mock_output.call_args_list[0][0][-1]
|
||||
|
Reference in New Issue
Block a user