@@ -68,6 +68,10 @@ def mkfile(self, name, contents):
6868 f .write (contents )
6969 return name
7070
71+ def readfile (self , name ):
72+ with open (name , 'rt' ) as f :
73+ return f .read ()
74+
7175
7276class AbsPathKeyTest (AbsTestCase ):
7377 def test_get_path_key (self ):
@@ -134,8 +138,12 @@ def test_nocase_findfile(self):
134138 cache = FileInfoCache ()
135139 a1 = self .mkfile ('aAaA/AaA1' , '1' )
136140 self .mkfile ('aAaA/Aaa2' , '2' )
141+ fs_case_sensitive = not os .path .exists ('aAaA/AAa2' )
137142 self .mkfile ('aAaA/AAa2' , '3' )
138143
144+ if not fs_case_sensitive :
145+ print ('skipping some tests due to case-insensitive filesystem.' )
146+
139147 self .assertEquals (a1 , cache .nocase_findfile (self .mkpath ('aaAA/aaa1' )))
140148 with self .assertRaises (IOError ) as cm :
141149 cache .nocase_findfile (self .mkpath ('aaAb/aaa1' ))
@@ -145,18 +153,24 @@ def test_nocase_findfile(self):
145153 cache .nocase_findfile (self .mkpath ('aaAA/aab1' ))
146154 self .assertEquals (errno .ENOENT , cm .exception .errno )
147155
148- with self .assertRaises (IOError ) as cm :
149- cache .nocase_findfile (self .mkpath ('aaAA/aaa2' ))
150- self .assertEquals (errno .EEXIST , cm .exception .errno )
156+ if fs_case_sensitive :
157+ with self .assertRaises (IOError ) as cm :
158+ cache .nocase_findfile (self .mkpath ('aaAA/aaa2' ))
159+ self .assertEquals (errno .EEXIST , cm .exception .errno )
151160
152161 def test_nocase_findfile_parent (self ):
153162 cache = FileInfoCache ()
154163 self .mkfile ('aaaA/aaA1' , '1' )
164+ fs_case_sensitive = not os .path .exists ('aAaA' )
155165 self .mkfile ('aAaA/aaa2' , '2' )
156166
167+ if not fs_case_sensitive :
168+ print ('skipping some tests due to case-insensitive filesystem.' )
169+
157170 # right now we don't handle this case, though it would be possible
158171 # to generate all possible matches and see if the number is exactly
159172 # one.
160- with self .assertRaises (IOError ) as cm :
161- cache .nocase_findfile (self .mkpath ('aaAA/aaa2' ))
162- self .assertEquals (errno .EEXIST , cm .exception .errno )
173+ if fs_case_sensitive :
174+ with self .assertRaises (IOError ) as cm :
175+ cache .nocase_findfile (self .mkpath ('aaAA/aaa2' ))
176+ self .assertEquals (errno .EEXIST , cm .exception .errno )
0 commit comments