def test_return_command_has_arguments(self): """Test that return dictionary has arguments attr.""" comm = command.parse_response(self.response) self.assertTrue(hasattr(comm, "arguments"))
def test_return_command_has_key_name(self): """Test that return dictionary has key_name attr.""" comm = command.parse_response(self.response) self.assertTrue(hasattr(comm, "key_name"))
def test_return_command_has_command(self): """Test that return dictionary has command attr.""" comm = command.parse_response(self.response) self.assertTrue(hasattr(comm, "command"))
def test_return_command_has_timestamp(self): """Test that return dictionary has timestamp attr.""" comm = command.parse_response(self.response) self.assertTrue(hasattr(comm, "timestamp"))
def test_return_Command(self): """Test that parse_response() return a dictionary.""" comm = command.parse_response(self.response) self.assertTrue(isinstance(comm, command.Command))
def test_raise_exception_inv_number_args(self): """Test parse_response() raise exception if body is not command.""" try: command.parse_response(b"OK") except Exception as e: self.assertEqual(e.args[0], "Invalid number of arguments")