Ejemplo n.º 1
0
 def test_check_for_translation_updates_with_dirty_repo(self):
     mock_repo = MagicMock()
     mock_repo.__str__.return_value = "mock_repo"
     mock_repo.is_dirty.return_value = True
     with mock.patch.object(git, "Repo") as mock_Repo:
         mock_Repo.return_value.__enter__.return_value = mock_repo
         helper = TransifexHelper()
         with self.assertRaisesMessage(Exception, "is dirty. We cannot continue."):
             helper.check_for_translation_updates()
Ejemplo n.º 2
0
 def test_check_for_translation_updates_with_no_legalcodes(self):
     mock_repo = MagicMock()
     mock_repo.__str__.return_value = "mock_repo"
     mock_repo.is_dirty.return_value = False
     with mock.patch.object(git, "Repo") as mock_Repo:
         mock_Repo.return_value.__enter__.return_value = mock_repo
         with mock.patch.object(
             TransifexHelper, "get_transifex_resource_stats"
         ) as mock_get_transifex_resource_stats:
             mock_get_transifex_resource_stats.return_value = {}
             helper = TransifexHelper()
             helper.check_for_translation_updates()