Exemplo n.º 1
0
    def test_get_interesting_sub_directories(self):
        interesting_path = InterestingPaths()
        interesting_path.mark_path_as_interesting('a/b/ca')
        interesting_path.mark_path_as_interesting('a/b/cb')
        interesting_path.mark_path_as_boring('a/b/ca/x')
        interesting_path.mark_path_as_boring('a/y')

        dirs = sorted(interesting_path.get_interesting_sub_directories('a/b'))
        self.assertEqual(dirs, ['a/b/ca', 'a/b/cb'])

        self.assertEqual([], interesting_path.get_interesting_sub_directories("a/b/c/x"))
    def test_get_interesting_sub_directories(self):
        interesting_path = InterestingPaths()
        interesting_path.mark_path_as_interesting('a/b/ca')
        interesting_path.mark_path_as_interesting('a/b/cb')
        interesting_path.mark_path_as_boring('a/b/ca/x')
        interesting_path.mark_path_as_boring('a/y')
        
        dirs = sorted(interesting_path.get_interesting_sub_directories('a/b'))
        self.assertEqual(dirs, [ 'a/b/ca', 'a/b/cb' ])

        self.assertEqual([], interesting_path.get_interesting_sub_directories("a/b/c/x"))
Exemplo n.º 3
0
    def test_empty_string(self):
        interesting_path = InterestingPaths()
        interesting_path.mark_path_as_interesting('')

        self.assertTrue(interesting_path.is_interesting('a'))
        self.assertTrue(interesting_path.is_interesting('b'))

        dirs = sorted(interesting_path.get_interesting_sub_directories('a'))
        self.assertEqual(dirs, ['a'])

        dirs = sorted(interesting_path.get_interesting_sub_directories(''))
        self.assertEqual(dirs, [''])
    def test_empty_string(self):
        interesting_path = InterestingPaths()
        interesting_path.mark_path_as_interesting('')

        self.assertTrue(interesting_path.is_interesting('a'))
        self.assertTrue(interesting_path.is_interesting('b'))

        dirs = sorted(interesting_path.get_interesting_sub_directories('a'))
        self.assertEqual(dirs, [ 'a' ])

        dirs = sorted(interesting_path.get_interesting_sub_directories(''))
        self.assertEqual(dirs, [ '' ])