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
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