mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* Add support for WebHDFS * Style and linting fixes * Implement abstract methods and disable no-member pylint errors * Add init unit test * Yield client and fix redefinition of hdfs * Get dynamic hdfs Docker port * Add support for open in WebHDFSTree * Remove hdfscli_config fallbacks in WebHDFSTree * Use port 50070 for webhdfs * WebHDFSTree supports http URL and proper walking * Fix failing unit test after refactoring * Add overwrite argument to upload * Add remaining func tests for webhdfs * Remove print statements * Allow dynamic attributes in pylint for hdfs library * Comment error on instantiating HDFS client from config * Remove depth argument from call to walk * Update dvc/tree/webhdfs.py * Remove unnecessary deque * Check exception messages hdfs client failure from config * Return client directly Co-authored-by: Ruslan Kuprieiev <[email protected]> * Split long line * Add size to HashInfo * Implement move via hdfs.rename * Add missing line * Make parent directories before moving file in WebHDFS * Add total to progress bar Co-authored-by: Ruslan Kuprieiev <[email protected]>
25 lines
633 B
Python
25 lines
633 B
Python
from dvc.tree.webhdfs import WebHDFSTree
|
|
|
|
user = "test"
|
|
webhdfs_token = "token"
|
|
webhdfs_alias = "alias-name"
|
|
hdfscli_config = "path/to/cli/config"
|
|
|
|
|
|
def test_init(dvc):
|
|
url = "webhdfs://[email protected]:50070"
|
|
config = {
|
|
"url": url,
|
|
"webhdfs_token": webhdfs_token,
|
|
"webhdfs_alias": webhdfs_alias,
|
|
"hdfscli_config": hdfscli_config,
|
|
"user": user,
|
|
}
|
|
|
|
tree = WebHDFSTree(dvc, config)
|
|
assert tree.path_info == url
|
|
assert tree.token == webhdfs_token
|
|
assert tree.alias == webhdfs_alias
|
|
assert tree.path_info.user == user
|
|
assert tree.hdfscli_config == hdfscli_config
|