def test_patch_exception_raised_when_operation_type_missing(self):
        invalid_operation = {
            'value': 'mock',
        }

        patch = Patch([])
        with self.assertRaises(PatchException):
            patch.get_operation(invalid_operation)
    def test_patch_exception_raised_when_operation_type_missing(self):
        invalid_operation = {
            'value': 'mock',
        }

        patch = Patch([])
        with self.assertRaises(PatchException):
            patch.get_operation(invalid_operation)
    def test_add_exception_instance_returned_for_operation_add(self):
        operation = {
            'op': 'add',
            'path': '/0',
            'value': 'mock',
        }

        patch = Patch([])
        add_operation = patch.get_operation(operation)
        self.assertIsInstance(add_operation, AddOperation)
    def test_add_exception_instance_returned_for_operation_add(self):
        operation = {
            'op': 'add',
            'path': '/0',
            'value': 'mock',
        }

        patch = Patch([])
        add_operation = patch.get_operation(operation)
        self.assertIsInstance(add_operation, AddOperation)