Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Ensuring paths for test inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
why-not-try-calmer committed Feb 15, 2023
1 parent 8a93c4e commit 3f98996
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytransifex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def push(input_directory: str | None):
path_to_files=files,
)
except Exception as error:
reply += f"Failed because of this error: {error}"
reply += f"cli:push failed because of this error: {error}"
finally:
click.echo(reply)
settings.to_disk()
Expand Down Expand Up @@ -125,7 +125,7 @@ def pull(output_directory: str | Path | None, only_lang: str | None):
output_dir=output_directory,
)
except Exception as error:
reply += f"Failed because of this error: {error}"
reply += f"cli:pull failed because of this error: {error}"
finally:
click.echo(reply)
settings.to_disk()
3 changes: 3 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def setUpClass(cls):
cls.path_to_file = Path.cwd().joinpath("tests", "input", "test_resource_fr.po")
cls.output_dir = Path.cwd().joinpath("tests", "output")

if missing := next(filter(lambda p: not p.exists(), [cls.path_to_file]), None):
raise ValueError(f"Unable to complete test with broken tests inputs. Found missing: {missing}")

if project := cls.tx.get_project(project_slug=cls.project_slug):
print("Found old project, removing.")
project.delete()
Expand Down
3 changes: 3 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def setUpClass(cls):
cls.path_to_file = cls.path_to_input_dir.joinpath("test_resource_fr.po")
cls.output_dir = Path.cwd().joinpath("tests", "output")

if missing := next(filter(lambda p: not p.exists(), [cls.path_to_file, cls.path_to_input_dir]), None):
raise ValueError(f"Unable to complete test with broken tests inputs. Found missing: {missing}")

if project := cls.tx.get_project(project_slug=cls.project_slug):
print("Found old project, removing.")
project.delete()
Expand Down

0 comments on commit 3f98996

Please sign in to comment.