-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_cli.py
23 lines (19 loc) · 958 Bytes
/
test_cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest
import synapse_uploader.cli as cli
from synapse_uploader.synapse_uploader import SynapseUploader
def test_cli(mocker, test_synapse_auth_token):
args = ['', 'syn123', '/tmp', '-r', '10', '-d', '20', '-t', '30',
'--auth-token', test_synapse_auth_token, '-ll', 'debug', '-f', '-cd', '/tmp/cache']
mocker.patch('sys.argv', args)
mocker.patch('src.synapse_uploader.synapse_uploader.SynapseUploader.execute')
mock_init = mocker.spy(SynapseUploader, '__init__')
with pytest.raises(SystemExit):
cli.main()
mock_init.assert_called_once_with(mocker.ANY,
'syn123',
'/tmp',
remote_path='10',
max_depth=20,
max_threads=30,
force_upload=True
)