예제 #1
0
    def test_read_stop_words(self):
        corpus = Corpus('')
        stopwords_file = StringIO('translator-credits')

        assert corpus._should_select_string(u'translator-credits', '*****@*****.**')
        corpus._read_stop_words(stopwords_file)
        assert not corpus._should_select_string(u'translator-credits', '*****@*****.**')
예제 #2
0
    def test_read_stop_words(self):
        corpus = Corpus('')
        stopwords_file = StringIO('translator-credits')

        assert corpus._should_select_string(u'translator-credits',
                                            '*****@*****.**')
        corpus._read_stop_words(stopwords_file)
        assert not corpus._should_select_string(u'translator-credits',
                                                '*****@*****.**')
예제 #3
0
 def test_should_select_string_empty_target(self):
     corpus = Corpus('')
     assert corpus._should_select_string(u'This week', 'Aquesta setmana')
     assert not corpus._should_select_string(u'This week', '')
예제 #4
0
 def test_should_select_string_nonumericalonly(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'10', '10')
     assert corpus._should_select_string(u'10 minutes ago', 'Fa 10 minuts')
예제 #5
0
 def test_should_select_string_noformatters(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'Usage: %s', 'Ús: %s')
     assert corpus._should_select_string(u'Usage: sample', 'Ús: exemple')
예제 #6
0
 def test_should_select_string_nospaces(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'accessibility;development;test;', 'accessibility;development;test;')
예제 #7
0
 def test_should_select_string_notags(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'<b>_User name</b>', '<b>_Nom d\'usuari</b>')
     assert corpus._should_select_string(u'User name', '_Nom d\'usuari')
예제 #8
0
 def test_should_not_select_parentesis_only(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'()', '()')
예제 #9
0
 def test_should_select_string_empty_target(self):
     corpus = Corpus('')
     assert corpus._should_select_string(u'This week', 'Aquesta setmana')
     assert not corpus._should_select_string(u'This week', '')
예제 #10
0
 def test_should_select_string_nonumericalonly(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'10', '10')
     assert corpus._should_select_string(u'10 minutes ago', 'Fa 10 minuts')
예제 #11
0
 def test_should_select_string_noformatters(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'Usage: %s', 'Ús: %s')
     assert corpus._should_select_string(u'Usage: sample', 'Ús: exemple')
예제 #12
0
 def test_should_select_string_nospaces(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(
         u'accessibility;development;test;',
         'accessibility;development;test;')
예제 #13
0
 def test_should_select_string_notags(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'<b>_User name</b>',
                                             '<b>_Nom d\'usuari</b>')
     assert corpus._should_select_string(u'User name', '_Nom d\'usuari')
예제 #14
0
 def test_should_select_string_empty_target(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'()', '()')
 def test_should_not_select_parentesis_only(self):
     corpus = Corpus('')
     assert not corpus._should_select_string(u'()', '()')