コード例 #1
0
    def test_l10n_not_merge_ftl(self):
        """Test that JarMaker doesn't merge source .ftl files"""
        self._create_fluent_setup()
        jm = JarMaker(outputFormat="symlink")
        jm.sourcedirs = [self.srcdir]
        jm.topsourcedir = self.srcdir
        jm.l10nbase = self.l10nbase
        jm.l10nmerge = self.l10nmerge
        jm.relativesrcdir = "app/locales"
        jm.makeJar(os.path.join(self.srcdir, "jar.mn"), self.builddir)

        # test.ftl should be taken from the l10ndir, since it is present there
        destpath = os.path.join(self.builddir, "localization", "test", "app",
                                "test.ftl")
        srcpath = os.path.join(self.l10nbase, "app", "app", "test.ftl")
        self.assertTrue(
            is_symlink_to(destpath, srcpath),
            "{0} should be a symlink to {1}".format(destpath, srcpath),
        )

        # test2.ftl on the other hand, is only present in en-US dir, and should
        # not be linked from the build dir
        destpath = os.path.join(self.builddir, "localization", "test", "app",
                                "test2.ftl")
        self.assertFalse(os.path.isfile(destpath),
                         "test2.ftl should not be taken from en-US")
コード例 #2
0
ファイル: test_jarmaker.py プロジェクト: luke-chang/gecko-1
    def test_l10n_not_merge_ftl(self):
        '''Test that JarMaker doesn't merge source .ftl files'''
        self._create_fluent_setup()
        jm = JarMaker(outputFormat='symlink')
        jm.sourcedirs = [self.srcdir]
        jm.topsourcedir = self.srcdir
        jm.l10nbase = self.l10nbase
        jm.l10nmerge = self.l10nmerge
        jm.relativesrcdir = 'app/locales'
        jm.makeJar(os.path.join(self.srcdir, 'jar.mn'), self.builddir)

        # test.ftl should be taken from the l10ndir, since it is present there
        destpath = os.path.join(
            self.builddir, 'localization', 'test', 'app', 'test.ftl')
        srcpath = os.path.join(self.l10nbase, 'app', 'app', 'test.ftl')
        self.assertTrue(is_symlink_to(destpath, srcpath),
                        '{0} should be a symlink to {1}'.format(destpath,
                                                                srcpath))

        # test2.ftl on the other hand, is only present in en-US dir, and should
        # not be linked from the build dir
        destpath = os.path.join(
            self.builddir, 'localization', 'test', 'app', 'test2.ftl')
        self.assertFalse(
            os.path.isfile(destpath),
            'test2.ftl should not be taken from en-US')
コード例 #3
0
    def test_l10n_not_merge_ftl(self):
        '''Test that JarMaker doesn't merge source .ftl files'''
        self._create_fluent_setup()
        jm = JarMaker(outputFormat='symlink')
        jm.sourcedirs = [self.srcdir]
        jm.topsourcedir = self.srcdir
        jm.l10nbase = self.l10nbase
        jm.l10nmerge = self.l10nmerge
        jm.relativesrcdir = 'app/locales'
        jm.makeJar(os.path.join(self.srcdir, 'jar.mn'), self.builddir)

        # test.ftl should be taken from the l10ndir, since it is present there
        destpath = os.path.join(self.builddir, 'localization', 'test', 'app',
                                'test.ftl')
        srcpath = os.path.join(self.l10nbase, 'app', 'app', 'test.ftl')
        self.assertTrue(
            is_symlink_to(destpath, srcpath),
            '{0} should be a symlink to {1}'.format(destpath, srcpath))

        # test2.ftl on the other hand, is only present in en-US dir, and should
        # not be linked from the build dir
        destpath = os.path.join(self.builddir, 'localization', 'test', 'app',
                                'test2.ftl')
        self.assertFalse(os.path.isfile(destpath),
                         'test2.ftl should not be taken from en-US')