Example #1
0
    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"))
Example #2
0
    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"))
Example #3
0
    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"))
Example #4
0
    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"))
Example #5
0
    def test_return_Command(self):
        """Test that parse_response() return a dictionary."""
        comm = command.parse_response(self.response)

        self.assertTrue(isinstance(comm, command.Command))
Example #6
0
 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")