diff options
Diffstat (limited to 'test_uploader.py')
-rw-r--r-- | test_uploader.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test_uploader.py b/test_uploader.py new file mode 100644 index 0000000..0f652ca --- /dev/null +++ b/test_uploader.py @@ -0,0 +1,20 @@ +import pytest + +from reddit_nextcloud_importer 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] |