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)
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()
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
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
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
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()
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)
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}"
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)
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()
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
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)