Example #1
0
    def make_release_tree(self, base_dir, files):
        # Run the parent command first
        sdist.make_release_tree(self, base_dir, files)

        # Run translation-canary in release mode to remove any bad translations
        sys.path.append('translation-canary')
        from translation_canary.translated import testSourceTree  # pylint: disable=import-error
        testSourceTree(base_dir, releaseMode=True)
Example #2
0
    def test_release_mode_failure_with_lingua(self):
        open(os.path.join(self.tmpdir, "aa.po"), "w").close()
        open(os.path.join(self.tmpdir, "pa.po"), "w").close()
        with open(os.path.join(self.tmpdir, "LINGUAS"), "w") as l:
            l.write("aa pa\n")

        self.assertTrue(testSourceTree(self.tmpdir, releaseMode=True))
        self.assertTrue(os.path.exists(os.path.join(self.tmpdir, "aa.po")))
        self.assertFalse(os.path.exists(os.path.join(self.tmpdir, "pa.po")))

        with open(os.path.join(self.tmpdir, "LINGUAS")) as l:
            self.assertEqual(l.read().strip(), "aa")
Example #3
0
 def test_release_mode_failure(self):
     open(os.path.join(self.tmpdir, "aa.po"), "w").close()
     open(os.path.join(self.tmpdir, "pa.po"), "w").close()
     self.assertTrue(testSourceTree(self.tmpdir, releaseMode=True))
     self.assertTrue(os.path.exists(os.path.join(self.tmpdir, "aa.po")))
     self.assertFalse(os.path.exists(os.path.join(self.tmpdir, "pa.po")))
Example #4
0
 def test_release_mode_success(self):
     open(os.path.join(self.tmpdir, "aa.po"), "w").close()
     open(os.path.join(self.tmpdir, "ab.po"), "w").close()
     self.assertTrue(testSourceTree(self.tmpdir, releaseMode=True))
Example #5
0
 def test_all_failure(self):
     open(os.path.join(self.tmpdir, "pa.po"), "w").close()
     open(os.path.join(self.tmpdir, "pb.po"), "w").close()
     self.assertFalse(testSourceTree(self.tmpdir))
Example #6
0
 def test_success(self):
     open(os.path.join(self.tmpdir, "aa.po"), "w").close()
     open(os.path.join(self.tmpdir, "ab.po"), "w").close()
     self.assertTrue(testSourceTree(self.tmpdir))
Example #7
0
 def test_release_mode_failure(self):
     open(os.path.join(self.tmpdir, "aa.po"), "w").close()
     open(os.path.join(self.tmpdir, "pa.po"), "w").close()
     self.assertTrue(testSourceTree(self.tmpdir, releaseMode=True))
     self.assertTrue(os.path.exists(os.path.join(self.tmpdir, "aa.po")))
     self.assertFalse(os.path.exists(os.path.join(self.tmpdir, "pa.po")))
Example #8
0
 def test_release_mode_success(self):
     open(os.path.join(self.tmpdir, "aa.po"), "w").close()
     open(os.path.join(self.tmpdir, "ab.po"), "w").close()
     self.assertTrue(testSourceTree(self.tmpdir, releaseMode=True))
Example #9
0
 def test_all_failure(self):
     open(os.path.join(self.tmpdir, "pa.po"), "w").close()
     open(os.path.join(self.tmpdir, "pb.po"), "w").close()
     self.assertFalse(testSourceTree(self.tmpdir))
Example #10
0
 def test_success(self):
     open(os.path.join(self.tmpdir, "aa.po"), "w").close()
     open(os.path.join(self.tmpdir, "ab.po"), "w").close()
     self.assertTrue(testSourceTree(self.tmpdir))