Esempio n. 1
0
class TestContext:
    def setUp(self):
        self.c = Context(None)

    def test_indent(self):
        assert self.c.indent == 0

    def test_scope(self):
        assert isinstance(self.c.scope, Scope)

    def test_str(self):
        assert str(self.c) == ''

    def test_add(self):
        self.c.add('foo')
        assert str(self.c) == 'foo'

        self.c.add('bar')
        assert str(self.c) == 'foobar'
Esempio n. 2
0
class TestContext:
    def setUp(self):
        self.c = Context(None)

    def test_indent(self):
        assert self.c.indent == 0

    def test_scope(self):
        assert isinstance(self.c.scope, Scope)

    def test_str(self):
        assert str(self.c) == ""

    def test_add(self):
        self.c.add("foo")
        assert str(self.c) == "foo"

        self.c.add("bar")
        assert str(self.c) == "foobar"
Esempio n. 3
0
class TestContext:
    def setUp(self):
        self.c = Context(None)

    def test_indent(self):
        assert self.c.indent == 0

    def test_scope(self):
        assert isinstance(self.c.scope, Scope)

    def test_str(self):
        assert str(self.c) == ''

    def test_add(self):
        self.c.add('foo')
        assert str(self.c) == 'foo'

        self.c.add('bar')
        assert str(self.c) == 'foobar'