Пример #1
0
    def testRegularLine(self):
        lines = [
            'messages: [i18n.t("productSync.error")],',
            'content: i18n.t("settings.expiryBanner.updateRMSKey"),'
        ]

        results = [bool(checkI18nExistance(x)) for x in lines]
        results | expect.to_not.contain(False)
Пример #2
0
 def testI18nMatchesIsolatedLine(self):
     line = 'i18n.t("settings.expiryBanner.expired")'
     match = checkI18nExistance(line)
     bool(match) | expect.to.be.true
Пример #3
0
 def testI18nDoesNotMatchWithoutOpeningNecessaryi18n_tCall(self):
     line = '("settings.expiryBanner.expired")'
     match = checkI18nExistance(line)
     bool(match) | expect.to.be.false
Пример #4
0
 def testI18nDoesNotMatchWithoutClosingQuotes(self):
     line = 'i18n.t("settings.expiryBanner.expired)'
     match = checkI18nExistance(line)
     bool(match) | expect.to.be.false
Пример #5
0
 def testI18nDoesNotMatchWithoutOpeningParenthesis(self):
     line = 'i18n.t"settings.expiryBanner.expired")'
     match = checkI18nExistance(line)
     bool(match) | expect.to.be.false
Пример #6
0
 def testI18nWithMultipleParameters(self):
     line = 'string += i18n.t("settings.expiryBanner.titleDays", daysToExpiry) + " "'
     match = checkI18nExistance(line)
     bool(match) | expect.to.be.true