File: test_remote.py

package info (click to toggle)
yarsync 0.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 652 kB
  • sloc: python: 2,615; makefile: 22
file content (19 lines) | stat: -rw-r--r-- 504 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pytest

from yarsync.yarsync import YARsync
from yarsync.yarsync import (
    COMMAND_ERROR
)


@pytest.mark.usefixtures("test_dir")
def test_remote_add(capfd):
    remote_command = "yarsync remote add".split()

    # adding existing remote fails
    ys = YARsync(remote_command + ["other_repo", "/some/path/"])
    returncode = ys()
    assert returncode == COMMAND_ERROR
    captured = capfd.readouterr()
    assert "remote other_repo exists, break." in captured.err
    assert not captured.out