6
6
7
7
def test_find_no_files (tmpdir ):
8
8
with tmpdir .as_cwd ():
9
- paths = list (find_all (os .getcwd (), 'readthedocs.yml' ))
9
+ paths = list (find_all (os .getcwd (), ( 'readthedocs.yml' ,) ))
10
10
assert len (paths ) == 0
11
11
12
12
13
13
def test_find_at_root (tmpdir ):
14
14
apply_fs (tmpdir , {'readthedocs.yml' : '' , 'otherfile.txt' : '' })
15
15
16
16
base = str (tmpdir )
17
- paths = list (find_all (base , 'readthedocs.yml' ))
17
+ paths = list (find_all (base , ( 'readthedocs.yml' ,) ))
18
18
assert paths == [
19
19
os .path .abspath (os .path .join (base , 'readthedocs.yml' ))
20
20
]
@@ -36,8 +36,42 @@ def test_find_nested(tmpdir):
36
36
apply_fs (tmpdir , {'first/readthedocs.yml' : '' })
37
37
38
38
base = str (tmpdir )
39
- paths = list (find_all (base , 'readthedocs.yml' ))
39
+ paths = list (find_all (base , ( 'readthedocs.yml' ,) ))
40
40
assert set (paths ) == set ([
41
41
str (tmpdir .join ('first' , 'readthedocs.yml' )),
42
42
str (tmpdir .join ('third' , 'readthedocs.yml' )),
43
43
])
44
+
45
+
46
+ def test_find_multiple_files (tmpdir ):
47
+ apply_fs (tmpdir , {
48
+ 'first' : {
49
+ 'readthedocs.yml' : '' ,
50
+ '.readthedocs.yml' : 'content' ,
51
+ },
52
+ 'second' : {
53
+ 'confuser.txt' : 'content' ,
54
+ },
55
+ 'third' : {
56
+ 'readthedocs.yml' : 'content' ,
57
+ 'Makefile' : '' ,
58
+ },
59
+ })
60
+ apply_fs (tmpdir , {'first/readthedocs.yml' : '' })
61
+
62
+ base = str (tmpdir )
63
+ paths = list (find_all (base , ('readthedocs.yml' ,
64
+ '.readthedocs.yml' )))
65
+ assert paths == [
66
+ str (tmpdir .join ('first' , 'readthedocs.yml' )),
67
+ str (tmpdir .join ('first' , '.readthedocs.yml' )),
68
+ str (tmpdir .join ('third' , 'readthedocs.yml' )),
69
+ ]
70
+
71
+ paths = list (find_all (base , ('.readthedocs.yml' ,
72
+ 'readthedocs.yml' )))
73
+ assert paths == [
74
+ str (tmpdir .join ('first' , '.readthedocs.yml' )),
75
+ str (tmpdir .join ('first' , 'readthedocs.yml' )),
76
+ str (tmpdir .join ('third' , 'readthedocs.yml' )),
77
+ ]
0 commit comments