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