def test_workflow(hdfs_cluster): w = WebHDFS(hdfs_cluster, user='******', data_proxy={'worker.example.com': 'localhost'}) fn = '/user/testuser/testrun/afile' w.mkdir('/user/testuser/testrun') with w.open(fn, 'wb') as f: f.write(b'hello') assert w.exists(fn) info = w.info(fn) assert info['size'] == 5 assert w.isfile(fn) assert w.cat(fn) == b'hello' w.rm('/user/testuser/testrun', recursive=True) assert not w.exists(fn)
def test_workflow(hdfs_cluster): w = WebHDFS(hdfs_cluster, user="******", data_proxy={"worker.example.com": "localhost"}) fn = "/user/testuser/testrun/afile" w.mkdir("/user/testuser/testrun") with w.open(fn, "wb") as f: f.write(b"hello") assert w.exists(fn) info = w.info(fn) assert info["size"] == 5 assert w.isfile(fn) assert w.cat(fn) == b"hello" w.rm("/user/testuser/testrun", recursive=True) assert not w.exists(fn)