def build_context(self): self.context = context.Context('test', 1)
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)
def test(self): """Verify that if network isn't setup, send just does nothing""" network.send(context.Context('test', 1))
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)
def test_by_name(self): with context.Context('test.foo') as ctx: test_ctx = context.find_context('test.foo') assert_equal(test_ctx, ctx)
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)
def test(self): with context.Context('test'): assert True
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)
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)
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)
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)
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)