コード例 #1
0
def test_get_service_path_soa_dir():
    service = 'some_service'
    soa_dir = 'some/path'

    service_path = get_service_path(service, soa_dir)

    assert service_path == '%s/%s' % (soa_dir, service)
コード例 #2
0
def test_get_service_path_cwd():
    service = None
    soa_dir = os.getcwd()

    service_path = get_service_path(service, soa_dir)

    assert service_path == os.getcwd()
コード例 #3
0
ファイル: test_cmds_validate.py プロジェクト: xcorail/paasta
def test_get_service_path_unknown(capfd):
    service = None
    soa_dir = 'unused'

    assert get_service_path(service, soa_dir) is None

    output, _ = capfd.readouterr()
    assert UNKNOWN_SERVICE in output
コード例 #4
0
def test_get_service_path_unknown(mock_stdout):
    service = None
    soa_dir = "unused"

    assert get_service_path(service, soa_dir) is None

    output = mock_stdout.getvalue()

    assert UNKNOWN_SERVICE in output
コード例 #5
0
def test_get_service_path_unknown(mock_stdout):
    service = None
    soa_dir = 'unused'

    assert get_service_path(service, soa_dir) is None

    output = mock_stdout.getvalue()

    assert UNKNOWN_SERVICE in output
コード例 #6
0
ファイル: test_cmds_validate.py プロジェクト: ycaihua/paasta
def test_get_service_path_cwd(mock_glob, mock_isdir):
    mock_isdir.return_value = True
    mock_glob.return_value = ['something.yaml']

    service = None
    soa_dir = os.getcwd()

    service_path = get_service_path(service, soa_dir)

    assert service_path == os.getcwd()
コード例 #7
0
ファイル: test_cmds_validate.py プロジェクト: ycaihua/paasta
def test_get_service_path_soa_dir(mock_glob, mock_isdir):
    mock_isdir.return_value = True
    mock_glob.return_value = ['something.yaml']

    service = 'some_service'
    soa_dir = 'some/path'

    service_path = get_service_path(service, soa_dir)

    assert service_path == '%s/%s' % (soa_dir, service)
コード例 #8
0
def test_get_service_path_soa_dir(mock_glob, mock_isdir):
    mock_isdir.return_value = True
    mock_glob.return_value = ["something.yaml"]

    service = "some_service"
    soa_dir = "some/path"

    service_path = get_service_path(service, soa_dir)

    assert service_path == f"{soa_dir}/{service}"
コード例 #9
0
def test_get_service_path_soa_dir(mock_glob, mock_isdir):
    mock_isdir.return_value = True
    mock_glob.return_value = ["something.yaml"]

    service = "some_service"
    soa_dir = "some/path"

    service_path = get_service_path(service, soa_dir)

    assert service_path == "%s/%s" % (soa_dir, service)
コード例 #10
0
def test_get_service_path_cwd(mock_glob, mock_isdir):
    mock_isdir.return_value = True
    mock_glob.return_value = ["something.yaml"]

    service = None
    soa_dir = os.getcwd()

    service_path = get_service_path(service, soa_dir)

    assert service_path == os.getcwd()
コード例 #11
0
ファイル: test_cmds_validate.py プロジェクト: somic/paasta
def test_get_service_path_unknown(
    mock_stdout
):
    service = None
    soa_dir = 'unused'

    assert get_service_path(service, soa_dir) is None

    output = mock_stdout.getvalue().decode('utf-8')

    assert UNKNOWN_SERVICE in output
コード例 #12
0
def test_get_service_path_soa_dir(
    mock_glob,
    mock_isdir
):
    mock_isdir.return_value = True
    mock_glob.return_value = ['something.yaml']

    service = 'some_service'
    soa_dir = 'some/path'

    service_path = get_service_path(service, soa_dir)

    assert service_path == '%s/%s' % (soa_dir, service)