@@ -544,7 +544,7 @@ def test_parse_errors(self):
544
544
"[Foo]\n wrong-indent\n " )
545
545
self .assertEqual (e .args , ('<???>' ,))
546
546
# read_file on a real file
547
- tricky = support .findfile ("cfgparser.3" )
547
+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
548
548
if self .delimiters [0 ] == '=' :
549
549
error = configparser .ParsingError
550
550
expected = (tricky ,)
@@ -718,7 +718,7 @@ class mystr(str):
718
718
def test_read_returns_file_list (self ):
719
719
if self .delimiters [0 ] != '=' :
720
720
self .skipTest ('incompatible format' )
721
- file1 = support .findfile ("cfgparser.1" )
721
+ file1 = support .findfile ("cfgparser.1" , subdir = "configdata" )
722
722
# check when we pass a mix of readable and non-readable files:
723
723
cf = self .newconfig ()
724
724
parsed_files = cf .read ([file1 , "nonexistent-file" ], encoding = "utf-8" )
@@ -751,7 +751,7 @@ def test_read_returns_file_list(self):
751
751
def test_read_returns_file_list_with_bytestring_path (self ):
752
752
if self .delimiters [0 ] != '=' :
753
753
self .skipTest ('incompatible format' )
754
- file1_bytestring = support .findfile ("cfgparser.1" ).encode ()
754
+ file1_bytestring = support .findfile ("cfgparser.1" , subdir = "configdata" ).encode ()
755
755
# check when passing an existing bytestring path
756
756
cf = self .newconfig ()
757
757
parsed_files = cf .read (file1_bytestring , encoding = "utf-8" )
@@ -1161,7 +1161,7 @@ class RawConfigParserTestSambaConf(CfgParserTestCaseClass, unittest.TestCase):
1161
1161
empty_lines_in_values = False
1162
1162
1163
1163
def test_reading (self ):
1164
- smbconf = support .findfile ("cfgparser.2" )
1164
+ smbconf = support .findfile ("cfgparser.2" , subdir = "configdata" )
1165
1165
# check when we pass a mix of readable and non-readable files:
1166
1166
cf = self .newconfig ()
1167
1167
parsed_files = cf .read ([smbconf , "nonexistent-file" ], encoding = 'utf-8' )
@@ -1356,7 +1356,7 @@ class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass, unittest.TestCase):
1356
1356
allow_no_value = True
1357
1357
1358
1358
def test_cfgparser_dot_3 (self ):
1359
- tricky = support .findfile ("cfgparser.3" )
1359
+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
1360
1360
cf = self .newconfig ()
1361
1361
self .assertEqual (len (cf .read (tricky , encoding = 'utf-8' )), 1 )
1362
1362
self .assertEqual (cf .sections (), ['strange' ,
@@ -1388,7 +1388,7 @@ def test_cfgparser_dot_3(self):
1388
1388
self .assertEqual (cf .get ('more interpolation' , 'lets' ), 'go shopping' )
1389
1389
1390
1390
def test_unicode_failure (self ):
1391
- tricky = support .findfile ("cfgparser.3" )
1391
+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
1392
1392
cf = self .newconfig ()
1393
1393
with self .assertRaises (UnicodeDecodeError ):
1394
1394
cf .read (tricky , encoding = 'ascii' )
@@ -1489,7 +1489,7 @@ def fromstring(self, string, defaults=None):
1489
1489
1490
1490
class FakeFile :
1491
1491
def __init__ (self ):
1492
- file_path = support .findfile ("cfgparser.1" )
1492
+ file_path = support .findfile ("cfgparser.1" , subdir = "configdata" )
1493
1493
with open (file_path , encoding = "utf-8" ) as f :
1494
1494
self .lines = f .readlines ()
1495
1495
self .lines .reverse ()
@@ -1510,7 +1510,7 @@ def readline_generator(f):
1510
1510
1511
1511
class ReadFileTestCase (unittest .TestCase ):
1512
1512
def test_file (self ):
1513
- file_paths = [support .findfile ("cfgparser.1" )]
1513
+ file_paths = [support .findfile ("cfgparser.1" , subdir = "configdata" )]
1514
1514
try :
1515
1515
file_paths .append (file_paths [0 ].encode ('utf8' ))
1516
1516
except UnicodeEncodeError :
0 commit comments