mirror of https://github.com/deadc0de6/catcli
add test for the tree command
parent
4c364a6e9d
commit
e2f33c99b0
@ -0,0 +1,39 @@
|
|||||||
|
"""
|
||||||
|
author: deadc0de6 (https://github.com/deadc0de6)
|
||||||
|
Copyright (c) 2017, deadc0de6
|
||||||
|
|
||||||
|
Basic unittest for tree
|
||||||
|
"""
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from catcli.catcli import *
|
||||||
|
from catcli.noder import Noder
|
||||||
|
from catcli.walker import Walker
|
||||||
|
from catcli.catalog import Catalog
|
||||||
|
from tests.helpers import *
|
||||||
|
|
||||||
|
|
||||||
|
class TestTree(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_tree(self):
|
||||||
|
# init
|
||||||
|
path = 'fake'
|
||||||
|
self.addCleanup(clean, path)
|
||||||
|
catalog = Catalog(path, force=True, verbose=False)
|
||||||
|
top = catalog._restore_json(get_fakecatalog())
|
||||||
|
noder = Noder()
|
||||||
|
|
||||||
|
# create fake args dict
|
||||||
|
args = {'<path>': path, '--verbose': True}
|
||||||
|
|
||||||
|
# print tree and wait for any errors
|
||||||
|
cmd_tree(args, noder, top)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
unittest.main()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue