Example #1
0
    def test_find(self):
        search = zyklop.search.Search('/', '^.*bin/instance',
                                     DummyTreeChildNodeProvider())
        # we'll use os.listdir to get the children
        found = search.find()
        self.assertTrue(found)
        self.assertTrue(found.path.endswith('folder1/bin/instance'))
        self.assertEquals(found.level, 2)

        search.regexp = re.compile('^.*bin$')
        found = search.find()
        self.assertTrue(found.path.endswith('folder1/bin'))
Example #2
0
 def test_noresult(self):
     search = zyklop.search.Search('/', 'foobarnotexist',
                                   DummyTreeChildNodeProvider())
     found = search.find()
     self.assertEquals(None, found)