コード例 #1
0
ファイル: test_utils.py プロジェクト: kotenev/typus
    def test_junk_delimiter(self):
        with self.assertRaises(ValueError):
            splinter('\\')

        with self.assertRaises(ValueError):
            splinter('\\  ')

        with self.assertRaises(ValueError):
            splinter('  ')
コード例 #2
0
ファイル: test_utils.py プロジェクト: kotenev/typus
 def test_doesnt_remove_other_slashes(self):
     split = splinter('*')
     self.assertEqual(split('a * b * c\*c \\b'), ['a', 'b', 'c*c \\b'])
コード例 #3
0
ファイル: test_utils.py プロジェクト: kotenev/typus
 def test_regex_delimiter(self):
     split = splinter('$')
     self.assertEqual(split('a$b$c'), ['a', 'b', 'c'])
コード例 #4
0
ファイル: test_utils.py プロジェクト: kotenev/typus
 def test_delimiter_with_spaces(self):
     split = splinter(' @  ')
     self.assertEqual(split('a@ b@ c '), ['a', 'b', 'c'])
コード例 #5
0
ファイル: test_utils.py プロジェクト: kotenev/typus
 def test_positional_spaces(self):
     split = splinter(';')
     self.assertEqual(split(' a; b;c'), ['a', 'b', 'c'])
     self.assertEqual(split(' a; b ;c'), ['a', 'b', 'c'])
     self.assertEqual(split(' a; b ;c '), ['a', 'b', 'c'])
コード例 #6
0
ファイル: test_utils.py プロジェクト: kotenev/typus
 def test_basic(self):
     split = splinter(',')
     self.assertEqual(split('a, b,c'), ['a', 'b', 'c'])
     self.assertEqual(split('a, b\,c'), ['a', 'b,c'])
コード例 #7
0
class TypusViewMixin:
    split_phrases = staticmethod(splinter(','))
    typus = {'en': en_typus, 'ru': ru_typus}