Esempio n. 1
0
 def build_context(self):
     self.context = context.Context('test', 1)
Esempio 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)
Esempio n. 3
0
 def test(self):
     """Verify that if network isn't setup, send just does nothing"""
     network.send(context.Context('test', 1))
Esempio 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)
Esempio 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)
Esempio 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)
Esempio n. 7
0
 def test(self):
     with context.Context('test'):
         assert True
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)