diff options
author | gabrielgio <gabriel.giovanini@pm.me> | 2021-07-14 21:23:44 +0200 |
---|---|---|
committer | gabrielgio <gabriel.giovanini@pm.me> | 2021-07-14 21:23:44 +0200 |
commit | 4d43e402b2b4e27bbbbfe557216d95963a27af72 (patch) | |
tree | 46f3013be10a1062280d64052bcb654d67084f91 /test/test_uploader.py | |
parent | 6887fcc0e42b1a64ed80f8565fe3099aaa818930 (diff) | |
download | reddit-nextcloud-importer-4d43e402b2b4e27bbbbfe557216d95963a27af72.tar.gz reddit-nextcloud-importer-4d43e402b2b4e27bbbbfe557216d95963a27af72.tar.bz2 reddit-nextcloud-importer-4d43e402b2b4e27bbbbfe557216d95963a27af72.zip |
feat: Add nextcloud path param
Add a new param to input the nextcloud root path.
Diffstat (limited to 'test/test_uploader.py')
-rw-r--r-- | test/test_uploader.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_uploader.py b/test/test_uploader.py new file mode 100644 index 0000000..bcdf04b --- /dev/null +++ b/test/test_uploader.py @@ -0,0 +1,20 @@ +import pytest + +from uploader import create_folders + + +@pytest.fixture +def nxc(mocker): + return mocker.MagicMock() + + +@pytest.mark.parametrize("path,folders", [ + ("folder1", ["/folder1"]), + ("folder1/folder2", ["/folder1", "/folder1/folder2"]), + ("/folder1/folder2", ["/folder1", "/folder1/folder2"]) +]) +def test_create_folders(nxc, path, folders): + create_folders(path, nxc) + + for call, folder in zip(nxc.method_calls, folders): + assert folder == call.args[0] |