Exemplo n.º 1
0
 def build_context(self):
     self.context = context.Context('test', 1)
Exemplo n.º 2
0
 def test_parent(self):
     with context.Context('test') as ctx:
         with context.Context('test.foo'):
             test_ctx = context.find_context('..')
             assert_equal(test_ctx, ctx)
Exemplo n.º 3
0
 def test(self):
     """Verify that if network isn't setup, send just does nothing"""
     network.send(context.Context('test', 1))
Exemplo n.º 4
0
 def test_skip_up(self):
     with context.Context('test', 5) as ctx:
         with context.Context('.bar'):
             test_ctx = context.find_closest_context('test')
             assert_equal(ctx, test_ctx)
Exemplo n.º 5
0
 def test_by_name(self):
     with context.Context('test.foo') as ctx:
         test_ctx = context.find_context('test.foo')
         assert_equal(test_ctx, ctx)
Exemplo n.º 6
0
 def test_simple(self):
     with context.Context('test.bar', 5) as ctx:
         test_ctx = context.find_closest_context('test.bar')
         assert_equal(ctx, test_ctx)
Exemplo n.º 7
0
 def test(self):
     with context.Context('test'):
         assert True
Exemplo n.º 8
0
 def test(self):
     with context.Context('test', 5):
         with context.Context('.bar'):
             with context.Context('^.foo') as c:
                 assert_equal(c.name, 'test.foo')
                 assert_equal(c.id, 5)
Exemplo n.º 9
0
 def test_explicit(self):
     with context.Context('test.bar', 5):
         with context.Context('test.bar.foo') as c:
             assert_equal(c.name, 'test.bar.foo')
             assert_equal(c.id, 5)
Exemplo n.º 10
0
 def test_from_top(self):
     with context.Context('test.bar', 5):
         with context.Context('^.bar.foo') as c:
             assert_equal(c.name, 'test.bar.foo')
             assert_equal(c.id, 5)
Exemplo n.º 11
0
 def test_relative(self):
     with context.Context('test.bar', 5):
         with context.Context('.bar.foo') as c:
             assert_equal(c.name, 'test.bar.foo')
             assert_equal(c.id, 5)
Exemplo n.º 12
0
 def test_top(self):
     with context.Context('test') as ctx:
         with context.Context('test.foo'):
             test_ctx = context.find_context('^')
             assert_equal(test_ctx, ctx)