Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
why-not-try-calmer committed Feb 21, 2023
1 parent ec8bd68 commit 3750bd9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions qgispluginci/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def __init__(
path_to_file=self.ts_file,
resource_slug=self.parameters.transifex_resource,
)
logger.info(
"Transifex project {self.parameters.transifex_organization}/"
f"{self.parameters.transifex_project} and resource have been created."
)
logger.info(f"""
Transifex project {self.parameters.transifex_organization}/
{self.parameters.transifex_project} and resource ({self.parameters.transifex_resource}) have been created.
""")
else:
logger.error(
"Project does not exists on Transifex: "
Expand Down
18 changes: 13 additions & 5 deletions test/test_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@


class TestTranslation(unittest.TestCase):
def setUp(self):
@classmethod
def setUpClass(cls):
""" Initialize the test case """
with open(".qgis-plugin-ci") as f:
arg_dict = yaml.safe_load(f)
self.parameters = Parameters(arg_dict)
self.transifex_token = os.getenv("transifex_token")
self.assertIsNotNone(self.transifex_token)
cls.parameters = Parameters(arg_dict)
cls.transifex_token = os.getenv("transifex_token")
cls.assertIsNotNone(cls.transifex_token)

def setUp(self):
""" Initialize the next test method (run between every test method) """
self.t = Translation(self.parameters, transifex_token=self.transifex_token)

def tearDown(self):
Expand All @@ -37,7 +42,10 @@ def tearDown(self):

@unittest.skipIf(can_skip_test(), "Missing transifex_token")
def test_creation(self):
self.t = Translation(self.parameters, transifex_token=self.transifex_token)
"""
Translation initialized from setUp, so we 'fake' a new test
by tearing it down
"""
self.tearDown()
self.t = Translation(self.parameters, transifex_token=self.transifex_token)

Expand Down

0 comments on commit 3750bd9

Please sign in to comment.