Beispiel #1
0
def test_test_case_init():
    test = _dummy_test
    context_factory = _dummy_context_factory
    tc = test_case.TestCase(test, context_factory)
    asserts.are_equal(tc.name, '_dummy_test')
    asserts.are_equal(tc.full_name, 'test_case_test._dummy_test')
    asserts.are_same(tc.test, test)
    asserts.is_not_none(tc.context)
    asserts.is_empty(tc.description)
    asserts.is_empty(tc.test_suites)
Beispiel #2
0
def test_test_case_init():
  test = _dummy_test
  context_factory = _dummy_context_factory
  tc = test_case.TestCase(test, context_factory)
  asserts.are_equal(tc.name, '_dummy_test')
  asserts.are_equal(tc.full_name, 'test_case_test._dummy_test')
  asserts.are_same(tc.test, test)
  asserts.is_not_none(tc.context)
  asserts.is_empty(tc.description)
  asserts.is_empty(tc.test_suites)
Beispiel #3
0
def test_test_init():
  t = Test('foo', 'bar.foo', 'foo bar test')
  asserts.are_equal(t.name, 'foo')
  asserts.are_equal(t.full_name, 'bar.foo')
  asserts.are_equal(t.description, 'foo bar test')
  asserts.is_empty(t.decorator_parameterizations)
  asserts.is_empty(t.setup)
  asserts.is_empty(t.teardown)
  asserts.is_empty(t.test_suite_names)
Beispiel #4
0
def test_test_init():
    t = Test('foo', 'bar.foo', 'foo bar test')
    asserts.are_equal(t.name, 'foo')
    asserts.are_equal(t.full_name, 'bar.foo')
    asserts.are_equal(t.description, 'foo bar test')
    asserts.is_empty(t.decorator_parameterizations)
    asserts.is_empty(t.setup)
    asserts.is_empty(t.teardown)
    asserts.is_empty(t.test_suite_names)
Beispiel #5
0
def test_test_clone():
  original = Test('foo', 'bar.foo', 'foo bar test')
  clone = original.clone()
  asserts.are_equal(clone.name, 'foo')
  asserts.are_equal(clone.full_name, 'bar.foo')
  asserts.are_equal(clone.description, 'foo bar test')
  asserts.is_empty(clone.decorator_parameterizations)
  asserts.is_empty(clone.setup)
  asserts.is_empty(clone.teardown)
  asserts.is_empty(clone.test_suite_names)
Beispiel #6
0
def test_test_clone():
    original = Test('foo', 'bar.foo', 'foo bar test')
    clone = original.clone()
    asserts.are_equal(clone.name, 'foo')
    asserts.are_equal(clone.full_name, 'bar.foo')
    asserts.are_equal(clone.description, 'foo bar test')
    asserts.is_empty(clone.decorator_parameterizations)
    asserts.is_empty(clone.setup)
    asserts.is_empty(clone.teardown)
    asserts.is_empty(clone.test_suite_names)
def test_registry_unregister_with_present_key():
  reg = registry.Registry()
  reg.register('foo', 4)
  asserts.are_equal(len(reg), 1)
  reg.unregister('foo')
  asserts.is_empty(reg)
def test_registry_init():
  reg = registry.Registry()
  asserts.is_empty(reg)
  asserts.is_empty(reg.keys())
  asserts.is_empty(reg.values())
Beispiel #9
0
def test_test_run_init():
  run = test_run.TestRun('foo')
  asserts.are_equal(run.name, 'foo')
  asserts.is_empty(run.variables)
  asserts.is_empty(run.setup)
  asserts.is_empty(run.teardown)
  asserts.is_empty(run.test_case_setup)
  asserts.is_empty(run.test_case_teardown)
  asserts.is_empty(run.test_suites)
  asserts.is_empty(run.parameterizations)
Beispiel #10
0
def test_test_run_init():
    run = test_run.TestRun('foo')
    asserts.are_equal(run.name, 'foo')
    asserts.is_empty(run.variables)
    asserts.is_empty(run.setup)
    asserts.is_empty(run.teardown)
    asserts.is_empty(run.test_case_setup)
    asserts.is_empty(run.test_case_teardown)
    asserts.is_empty(run.test_suites)
    asserts.is_empty(run.parameterizations)
Beispiel #11
0
def test_registry_unregister_with_nonexistent_key():
    reg = registry.Registry()
    reg.unregister('foo')
    asserts.is_empty(reg)
Beispiel #12
0
def test_registry_unregister_with_present_key():
    reg = registry.Registry()
    reg.register('foo', 4)
    asserts.are_equal(len(reg), 1)
    reg.unregister('foo')
    asserts.is_empty(reg)
Beispiel #13
0
def test_registry_init():
    reg = registry.Registry()
    asserts.is_empty(reg)
    asserts.is_empty(reg.keys())
    asserts.is_empty(reg.values())
Beispiel #14
0
def test_assert_empty_bad(collection):
    with asserts.expect_exception(AssertionError):
        asserts.is_empty(collection)
def test_registry_unregister_with_nonexistent_key():
  reg = registry.Registry()
  reg.unregister('foo')
  asserts.is_empty(reg)
Beispiel #16
0
def test_parameterization_init():
    param = parameterization.Parameterization('name')
    asserts.are_equal(param.name, 'name')
    asserts.is_empty(param.variables)
Beispiel #17
0
def test_assert_empty_ok(collection):
    asserts.is_empty(collection)
Beispiel #18
0
def test_assert_empty_bad(collection):
    with asserts.expect_exception(AssertionError):
        asserts.is_empty(collection)
def test_parameterization_init():
  param = parameterization.Parameterization('name')
  asserts.are_equal(param.name, 'name')
  asserts.is_empty(param.variables)
Beispiel #20
0
def test_assert_empty_ok(collection):
    asserts.is_empty(collection)