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

Commit

Permalink
Test for public projects
Browse files Browse the repository at this point in the history
  • Loading branch information
why-not-try-calmer committed Feb 20, 2023
1 parent 88f30e1 commit 3e1b719
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pytransifex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ def list_languages(self, project_slug: str, resource_slug: str) -> list[str]:

language_codes = []
for tr in it:
"""
"""
FIXME
This is hideous and probably unsound for some language_codes.
This is hideous and probably unsound for some language_codes.
Couldn't find a more direct accessor to language codes.
"""
code = tr.rsplit("_", 1)[-1][:-1]
code = str(tr).rsplit("_", 1)[-1][:-1]
language_codes.append(code)

logging.info(f"Obtained these languages: {language_codes}")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test8_get_translation(self):

def test9_project_exists(self):
verdict = self.tx.project_exists(project_slug=self.project_slug)
assert verdict is not None
assert verdict

def test10_ping(self):
self.tx.ping()
Expand Down
4 changes: 4 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ def test1_map_async(self):
def test2_map_async(self):
res = concurrently(fn=fn, args=self.args)
assert res == self.res


if __name__ == "__main__":
unittest.main()

0 comments on commit 3e1b719

Please sign in to comment.