Tidy up formatting
This commit is contained in:
@@ -45,8 +45,8 @@ def dummy_cfg(tmp_path):
|
||||
@pytest.fixture
|
||||
def dummy_compact_cfg():
|
||||
return DummyCfg(
|
||||
repo="user@host:/repo",
|
||||
env={"BORG_PASSPHRASE": "hunter2"},
|
||||
repo='user@host:/repo',
|
||||
env={'BORG_PASSPHRASE': 'hunter2'},
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from locutus import LocutusConfig
|
||||
|
||||
@@ -149,31 +149,31 @@ def test_list_no_archives(mock_subproc, mock_config, capsys):
|
||||
mock_subproc.return_value.returncode
|
||||
|
||||
|
||||
@mock.patch("locutus.list.LocutusConfig")
|
||||
@mock.patch("subprocess.run")
|
||||
@mock.patch('locutus.list.LocutusConfig')
|
||||
@mock.patch('subprocess.run')
|
||||
def test_list_no_archives_main(mock_subproc, mock_config, capsys):
|
||||
mock_config.return_value.get_repo.return_value = "/repo"
|
||||
mock_config.return_value.get_repo.return_value = '/repo'
|
||||
mock_config.return_value.env = {}
|
||||
mock_subproc.return_value.stdout = "" # No archives
|
||||
mock_subproc.return_value.stdout = '' # No archives
|
||||
mock_subproc.return_value.returncode = 0
|
||||
|
||||
args = make_args("dummy.toml", "dummy.rc")
|
||||
args = make_args('dummy.toml', 'dummy.rc')
|
||||
rc = run_list(args)
|
||||
assert rc == 0
|
||||
out = capsys.readouterr().out
|
||||
assert "No archives found" in out
|
||||
assert 'No archives found' in out
|
||||
|
||||
|
||||
@mock.patch("locutus.list.LocutusConfig")
|
||||
@mock.patch("subprocess.run")
|
||||
@mock.patch('locutus.list.LocutusConfig')
|
||||
@mock.patch('subprocess.run')
|
||||
def test_list_by_index_no_archives(mock_subproc, mock_config, capsys):
|
||||
mock_config.return_value.get_repo.return_value = "/repo"
|
||||
mock_config.return_value.get_repo.return_value = '/repo'
|
||||
mock_config.return_value.env = {}
|
||||
mock_subproc.return_value.stdout = "" # No archives
|
||||
mock_subproc.return_value.stdout = '' # No archives
|
||||
mock_subproc.return_value.returncode = 0
|
||||
|
||||
args = make_args("dummy.toml", "dummy.rc", target="0")
|
||||
args = make_args('dummy.toml', 'dummy.rc', target='0')
|
||||
rc = run_list(args)
|
||||
assert rc == 1
|
||||
out = capsys.readouterr().out
|
||||
assert "No archives found" in out
|
||||
assert 'No archives found' in out
|
||||
|
||||
Reference in New Issue
Block a user