aboutsummaryrefslogtreecommitdiff
path: root/test_uploader.py
blob: 0f652ca62b7bb251842de86243550ec810a1b9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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]