# Path: nolang/error.py
# class AppError(Exception):
#     def __init__(self, w_exception):
#         self.w_exception = w_exception
#         self.traceback = None
# 
#     def record_position(self, frame, bytecode, index):
#         self.traceback = TracebackElem(frame, index, bytecode, self.traceback)
# 
#     def match(self, space, w_expected):
#         return space.issubclass(space.type(self.w_exception), w_expected)
# 
#     def __repr__(self):
#         return '<AppError %r>' % (self.w_exception,)
#     __str__ = __repr__


from nolang.error import AppError
from support import BaseTest
        assert self.interpret_expr('return "c" in ["a", "b"];') is self.space.w_False

    def test_not_in(self):
        assert self.interpret_expr('return "c" not in ["a", "b"];') is self.space.w_True
        assert self.interpret_expr('return "a" not in ["a", "b"];') is self.space.w_False

    def test_append(self):
        w_res = self.interpret_expr('''
            let x;
            x = ["foo"];
            x.append("bar");
            return x;
        ''')
        space = self.space
        assert space.len(w_res) == 2
        assert space.utf8_w(space.getitem(w_res, space.newint(1))) == "bar"

    def test_extend(self):
        w_res = self.interpret_expr('''
            let x;
            x = ["a", "b"];
            x.extend(["c", "d"]);
            return x;
        ''')
        list_w = self.space.listview(w_res)
        assert [self.space.utf8_w(w) for w in list_w] == ["a", "b", "c", "d"]

    def test_extend_nonlist(self):
        try:
            self.interpret_expr('["a", "b"].extend("c");')

# Path: nolang/error.py
# class AppError(Exception):
#     def __init__(self, w_exception):
#         self.w_exception = w_exception
#         self.traceback = None
# 
#     def record_position(self, frame, bytecode, index):
#         self.traceback = TracebackElem(frame, index, bytecode, self.traceback)
# 
#     def match(self, space, w_expected):
#         return space.issubclass(space.type(self.w_exception), w_expected)
# 
#     def __repr__(self):
#         return '<AppError %r>' % (self.w_exception,)
#     __str__ = __repr__


# Path: tests/test_list.py
from nolang.error import AppError
from support import BaseTest

        assert self.interpret_expr('return "c" in ["a", "b"];') is self.space.w_False

    def test_not_in(self):
        assert self.interpret_expr('return "c" not in ["a", "b"];') is self.space.w_True
        assert self.interpret_expr('return "a" not in ["a", "b"];') is self.space.w_False

    def test_append(self):
        w_res = self.interpret_expr('''
            let x;
            x = ["foo"];
            x.append("bar");
            return x;
        ''')
        space = self.space
        assert space.len(w_res) == 2
        assert space.utf8_w(space.getitem(w_res, space.newint(1))) == "bar"

    def test_extend(self):
        w_res = self.interpret_expr('''
            let x;
            x = ["a", "b"];
            x.extend(["c", "d"]);
            return x;
        ''')
        list_w = self.space.listview(w_res)
        assert [self.space.utf8_w(w) for w in list_w] == ["a", "b", "c", "d"]

    def test_extend_nonlist(self):
        try:
            self.interpret_expr('["a", "b"].extend("c");')

        except AppError as ae: