def test_default(self): self.assertPathListEqual(find.find(self.env, '**'), [ srcpath('file.cpp'), srcpath('file.cpp~'), srcpath('dir/file2.txt') ]) self.assertPathListEqual(find.find(self.env, '**/'), [ srcpath('./'), srcpath('dir/'), srcpath('dir2/'), srcpath('dir/sub/') ])
def test_flat(self): with mock_context(): self.assertEqual( find.find(self.env, flat=True), [srcpath('.'), srcpath('dir'), srcpath('file.cpp')])
def test_dir(self): self.assertPathListEqual(find.find(self.env, '**', type='d'), [ srcpath('./'), srcpath('dir/'), srcpath('dir2/'), srcpath('dir/sub/') ])
def test_default(self): with mock_context(): self.assertEqual(find.find(self.env), [ srcpath('.'), srcpath('dir'), srcpath('file.cpp'), srcpath('dir/file2.txt') ])
def test_dir(self): with mock_context(): self.assertEqual(find.find(self.env, type='d'), [srcpath('.'), srcpath('dir')])
def test_file(self): with mock_context(): self.assertEqual(find.find(self.env, type='f'), [srcpath('file.cpp'), srcpath('dir/file2.txt')])
def test_multiple_patterns(self): self.assertPathListEqual( find.find(self.env, ['*.cpp', 'dir/*.txt']), [srcpath('file.cpp'), srcpath('dir/file2.txt')])
def test_file(self): self.assertPathListEqual(find.find(self.env, '**', type='f'), [ srcpath('file.cpp'), srcpath('file.cpp~'), srcpath('dir/file2.txt') ])