Exemplo n.º 1
0
    def test_starts_with(self):
        q = CollectionBase()
        q.FILENAME = './tests/testnames.tsv'

        q.patterns = []
        q.starts_with('c')
        assert_equal(list(q), [Name('abc\tcde'), Name('rst\tcuvw')])
        q.patterns = []
        q.starts_with('i')
        assert_equal(list(q), [Name('fgh\tijk')])
Exemplo n.º 2
0
 def test_methodcailing(self):
     q = CollectionBase()
     q.FILENAME = './tests/testnames.tsv'
     assert_equal(list(q.starts_with('c')),
                  [Name('abc\tcde'), Name('rst\tcuvw')])
     q.patterns = []
     assert_equal(list(q.contains('a').starts_with('c')),
                  [Name('abc\tcde')])