blob: 7fe2f4478ee5ab7616056bfa520a6efc470dd5df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import pytest
from importer.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]
|