コード例 #1
0
def test_handle_to_from_string():
    handle = SolidHandle("baz", SolidHandle("bar", SolidHandle("foo", None)))
    assert handle.to_string() == "foo.bar.baz"
    assert SolidHandle.from_string(handle.to_string()) == handle

    handle = SolidHandle("foo", None)
    assert handle.to_string() == "foo"
    assert SolidHandle.from_string(handle.to_string()) == handle
コード例 #2
0
def test_handle_to_from_string():
    handle = SolidHandle('baz', SolidHandle('bar', SolidHandle('foo', None)))
    assert handle.to_string() == 'foo.bar.baz'
    assert SolidHandle.from_string(handle.to_string()) == handle

    handle = SolidHandle('foo', None)
    assert handle.to_string() == 'foo'
    assert SolidHandle.from_string(handle.to_string()) == handle