예제 #1
0
 def test_unsorted(self):
     first = POEntry(msgid="Second", msgstr="Translation")
     second = POEntry(msgid="First", msgstr="Translation")
     status = Status()
     status.step(first)
     status.step(second)
     self.assertFalse(sort_validator(status))
예제 #2
0
파일: test_linter.py 프로젝트: ziima/polint
    def test_next_step(self):
        status = Status()
        status.step(sentinel.first)
        status.step(sentinel.second)

        self.assertEqual(status.entry, sentinel.second)
        self.assertEqual(status.previous, sentinel.first)
예제 #3
0
 def test_fail(self):
     entry = POEntry(msgid="Source",
                     msgstr="Translation",
                     occurrences=[('source.py', 1)])
     status = Status()
     status.step(entry)
     self.assertFalse(no_location_validator(status))
예제 #4
0
 def test_msgctxt_both(self):
     first = POEntry(msgid="First", msgstr="Trans.", msgctxt="abbrev.")
     second = POEntry(msgid="First", msgstr="Translation", msgctxt="long")
     status = Status()
     status.step(first)
     status.step(second)
     self.assertTrue(sort_validator(status))
예제 #5
0
 def test_fail_multiple_flags(self):
     entry = POEntry(msgid="Source",
                     msgstr="Translation",
                     flags=['another', 'fuzzy', 'flag'])
     status = Status()
     status.step(entry)
     self.assertFalse(fuzzy_validator(status))
예제 #6
0
 def test_msgctxt_both(self):
     first = POEntry(msgid="First", msgstr="Trans.", msgctxt="abbrev.")
     second = POEntry(msgid="First", msgstr="Translation", msgctxt="long")
     status = Status()
     status.step(first)
     status.step(second)
     self.assertTrue(sort_validator(status))
예제 #7
0
 def test_unsorted(self):
     first = POEntry(msgid="Second", msgstr="Translation")
     second = POEntry(msgid="First", msgstr="Translation")
     status = Status()
     status.step(first)
     status.step(second)
     self.assertFalse(sort_validator(status))
예제 #8
0
 def test_fail_fuzzy(self):
     # Fuzzy translations are considered untranslated
     entry = POEntry(msgid="Source", msgstr="Translation", flags=['fuzzy'])
     status = Status()
     status.step(entry)
     self.assertFalse(untranslated_validator(status))
예제 #9
0
 def test_fail_missing(self):
     entry = POEntry(msgid="Source", msgstr="")
     status = Status()
     status.step(entry)
     self.assertFalse(untranslated_validator(status))
예제 #10
0
 def test_fail(self):
     entry = POEntry(msgid="Source", msgstr="Translation", obsolete=True)
     status = Status()
     status.step(entry)
     self.assertFalse(obsolete_validator(status))
예제 #11
0
 def test_fail_multiple_flags(self):
     entry = POEntry(msgid="Source", msgstr="Translation", flags=['another', 'fuzzy', 'flag'])
     status = Status()
     status.step(entry)
     self.assertFalse(fuzzy_validator(status))
예제 #12
0
 def test_fail_fuzzy(self):
     entry = POEntry(msgid="Source", msgstr="Translation", flags=['fuzzy'])
     status = Status()
     status.step(entry)
     self.assertFalse(fuzzy_validator(status))
예제 #13
0
파일: test_linter.py 프로젝트: ziima/polint
    def test_first_step(self):
        status = Status()
        status.step(sentinel.first)

        self.assertEqual(status.entry, sentinel.first)
        self.assertIsNone(status.previous)
예제 #14
0
 def test_fail(self):
     entry = POEntry(msgid="Source", msgstr="Translation", occurrences=[('source.py', 1)])
     status = Status()
     status.step(entry)
     self.assertFalse(no_location_validator(status))
예제 #15
0
 def test_pass(self):
     entry = POEntry(msgid="Source", msgstr="Translation")
     status = Status()
     status.step(entry)
     self.assertTrue(no_location_validator(status))
예제 #16
0
 def test_fail_obsolete(self):
     # Obsolete translations are considered untranslated
     entry = POEntry(msgid="Source", msgstr="Translation", obsolete=True)
     status = Status()
     status.step(entry)
     self.assertFalse(untranslated_validator(status))
예제 #17
0
 def test_fail_fuzzy(self):
     # Fuzzy translations are considered untranslated
     entry = POEntry(msgid="Source", msgstr="Translation", flags=['fuzzy'])
     status = Status()
     status.step(entry)
     self.assertFalse(untranslated_validator(status))
예제 #18
0
 def test_fail_missing(self):
     entry = POEntry(msgid="Source", msgstr="")
     status = Status()
     status.step(entry)
     self.assertFalse(untranslated_validator(status))
예제 #19
0
 def test_fail(self):
     entry = POEntry(msgid="Source", msgstr="Translation", obsolete=True)
     status = Status()
     status.step(entry)
     self.assertFalse(obsolete_validator(status))
예제 #20
0
 def test_fail_obsolete(self):
     # Obsolete translations are considered untranslated
     entry = POEntry(msgid="Source", msgstr="Translation", obsolete=True)
     status = Status()
     status.step(entry)
     self.assertFalse(untranslated_validator(status))
예제 #21
0
 def test_pass(self):
     entry = POEntry(msgid="Source", msgstr="Translation")
     status = Status()
     status.step(entry)
     self.assertTrue(no_location_validator(status))
예제 #22
0
 def test_fail_fuzzy(self):
     entry = POEntry(msgid="Source", msgstr="Translation", flags=['fuzzy'])
     status = Status()
     status.step(entry)
     self.assertFalse(fuzzy_validator(status))
예제 #23
0
 def test_first_entry(self):
     entry = POEntry(msgid="Source", msgstr="Translation")
     status = Status()
     status.step(entry)
     self.assertTrue(sort_validator(status))
예제 #24
0
 def test_first_entry(self):
     entry = POEntry(msgid="Source", msgstr="Translation")
     status = Status()
     status.step(entry)
     self.assertTrue(sort_validator(status))