コード例 #1
0
ファイル: test_waq_scenario.py プロジェクト: wefleenor/stompy
def test_named_objects_retain_case():
    # maintain case through addition
    a = waq_scenario.NamedObjects('scenario')
    a['A'] = Foo()
    a['b'] = Foo()

    b = waq_scenario.NamedObjects('scenario')
    b['C'] = Foo()
    b['d'] = Foo()

    ab = a + b
    assert (ab['a'].name == 'A')
    assert (ab['d'].name == 'd')
コード例 #2
0
ファイル: test_waq_scenario.py プロジェクト: wefleenor/stompy
def test_named_objects():
    a = waq_scenario.NamedObjects('scenario')
    a['a'] = Foo()
    a['b'] = Foo()

    b = waq_scenario.NamedObjects('scenario')
    b['c'] = Foo()
    b['d'] = Foo()

    ab = a + b
    # simple check that ordering is preserved
    assert (ab.keys() == ['a', 'b', 'c', 'd'])
    assert ((b + a).keys() == ['c', 'd', 'a', 'b'])
コード例 #3
0
ファイル: test_waq_scenario.py プロジェクト: wefleenor/stompy
def test_named_objects_case_insensitive():
    # case insensitivity
    c = waq_scenario.NamedObjects('scenario')
    c['Hello'] = hello = Foo()
    assert (c['Hello'] == c['hello'] == c['HELLO'] == hello)
    del c['hELlo']