@@ -543,7 +543,7 @@ def test_parse_errors(self):
543
543
"[Foo]\n wrong-indent\n " )
544
544
self .assertEqual (e .args , ('<???>' ,))
545
545
# read_file on a real file
546
- tricky = support .findfile ("cfgparser.3" )
546
+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
547
547
if self .delimiters [0 ] == '=' :
548
548
error = configparser .ParsingError
549
549
expected = (tricky ,)
@@ -717,7 +717,7 @@ class mystr(str):
717
717
def test_read_returns_file_list (self ):
718
718
if self .delimiters [0 ] != '=' :
719
719
self .skipTest ('incompatible format' )
720
- file1 = support .findfile ("cfgparser.1" )
720
+ file1 = support .findfile ("cfgparser.1" , subdir = "configdata" )
721
721
# check when we pass a mix of readable and non-readable files:
722
722
cf = self .newconfig ()
723
723
parsed_files = cf .read ([file1 , "nonexistent-file" ], encoding = "utf-8" )
@@ -750,7 +750,7 @@ def test_read_returns_file_list(self):
750
750
def test_read_returns_file_list_with_bytestring_path (self ):
751
751
if self .delimiters [0 ] != '=' :
752
752
self .skipTest ('incompatible format' )
753
- file1_bytestring = support .findfile ("cfgparser.1" ).encode ()
753
+ file1_bytestring = support .findfile ("cfgparser.1" , subdir = "configdata" ).encode ()
754
754
# check when passing an existing bytestring path
755
755
cf = self .newconfig ()
756
756
parsed_files = cf .read (file1_bytestring , encoding = "utf-8" )
@@ -1126,7 +1126,7 @@ class RawConfigParserTestSambaConf(CfgParserTestCaseClass, unittest.TestCase):
1126
1126
empty_lines_in_values = False
1127
1127
1128
1128
def test_reading (self ):
1129
- smbconf = support .findfile ("cfgparser.2" )
1129
+ smbconf = support .findfile ("cfgparser.2" , subdir = "configdata" )
1130
1130
# check when we pass a mix of readable and non-readable files:
1131
1131
cf = self .newconfig ()
1132
1132
parsed_files = cf .read ([smbconf , "nonexistent-file" ], encoding = 'utf-8' )
@@ -1321,7 +1321,7 @@ class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass, unittest.TestCase):
1321
1321
allow_no_value = True
1322
1322
1323
1323
def test_cfgparser_dot_3 (self ):
1324
- tricky = support .findfile ("cfgparser.3" )
1324
+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
1325
1325
cf = self .newconfig ()
1326
1326
self .assertEqual (len (cf .read (tricky , encoding = 'utf-8' )), 1 )
1327
1327
self .assertEqual (cf .sections (), ['strange' ,
@@ -1353,7 +1353,7 @@ def test_cfgparser_dot_3(self):
1353
1353
self .assertEqual (cf .get ('more interpolation' , 'lets' ), 'go shopping' )
1354
1354
1355
1355
def test_unicode_failure (self ):
1356
- tricky = support .findfile ("cfgparser.3" )
1356
+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
1357
1357
cf = self .newconfig ()
1358
1358
with self .assertRaises (UnicodeDecodeError ):
1359
1359
cf .read (tricky , encoding = 'ascii' )
@@ -1454,7 +1454,7 @@ def fromstring(self, string, defaults=None):
1454
1454
1455
1455
class FakeFile :
1456
1456
def __init__ (self ):
1457
- file_path = support .findfile ("cfgparser.1" )
1457
+ file_path = support .findfile ("cfgparser.1" , subdir = "configdata" )
1458
1458
with open (file_path , encoding = "utf-8" ) as f :
1459
1459
self .lines = f .readlines ()
1460
1460
self .lines .reverse ()
@@ -1475,7 +1475,7 @@ def readline_generator(f):
1475
1475
1476
1476
class ReadFileTestCase (unittest .TestCase ):
1477
1477
def test_file (self ):
1478
- file_paths = [support .findfile ("cfgparser.1" )]
1478
+ file_paths = [support .findfile ("cfgparser.1" , subdir = "configdata" )]
1479
1479
try :
1480
1480
file_paths .append (file_paths [0 ].encode ('utf8' ))
1481
1481
except UnicodeEncodeError :
0 commit comments