コード例 #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"))
コード例 #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"))
コード例 #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"))
コード例 #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"))
コード例 #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))
コード例 #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")