def test_remove_namespace_with_resp_keys(self): resp = remove_namespace("namespace:", { b"key1": b"namespace:val1", b"key2": b"namespace:val2", b"key3": b"namespace:val3", }, [b"key1", b"key3"]) assert resp == { b"key1": b"val1", b"key2": b"namespace:val2", b"key3": b"val3", }
def test_remove_namespace_with_iterable(self): resp = remove_namespace( "namespace:", [b"namespace:val1", b"namespace:val2"]) assert resp == (b"val1", b"val2")
def test_remove_namespace_with_bytes(self): assert remove_namespace("namespace:", b"namespace:val") == b"val"
def test_remove_namespace_with_bytes_only_removes_first_instance(self): assert remove_namespace( "namespace:", b"namespace:namespace:val") == b"namespace:val"
def test_remove_namespace_with_int_float_bool(self): assert remove_namespace("namespace:", 1) == 1 assert remove_namespace("namespace:", 1.1) == 1.1 assert remove_namespace("namespace:", False) is False