コード例 #1
0
ファイル: test_context.py プロジェクト: ztane/jaspyx
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"
コード例 #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'
コード例 #3
0
ファイル: test_context.py プロジェクト: iksteen/jaspyx
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'
コード例 #4
0
 def setUp(self):
     self.v = DefaultVisitor('test.jpx', {}, 0)
     self.v.push(Context(None))
コード例 #5
0
 def setUp(self):
     p = Context(None)
     self.c = ClassContext(p, 'foo')
コード例 #6
0
 def setUp(self):
     p = Context(None)
     p.scope.prefix.extend(['foo', 'prototype'])
     self.c = ClassContext(p, 'bar')
コード例 #7
0
ファイル: test_context.py プロジェクト: ztane/jaspyx
 def setUp(self):
     self.c = Context(None)
コード例 #8
0
 def setUp(self):
     self.c = Context(None)
コード例 #9
0
 def setUp(self):
     self.c1 = Context(None)
     self.c1.indent = 2
     self.c2 = Context(self.c1)