Skip to content

Commit

Permalink
fixup! squash! temp file handling part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
tstenner committed Feb 6, 2017
1 parent 77c3f78 commit 1bc6410
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/TestDeepScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_delete(self):
f_keep = self.write_file('foo.txt')
subdir = os.path.join(self.tempdir, 'sub')
os.mkdir(subdir)
f_del2 = self.write_file('sub/bar.ini.bbtestbak')
f_del2 = self.write_file(os.path.join(subdir,'bar.ini.bbtestbak'))

# sanity check
self.assertExists(f_del1)
Expand Down
2 changes: 1 addition & 1 deletion tests/TestFileUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
def test_ini_helper(self, execute):
"""Used to test .ini cleaning in TestAction and in TestFileUtilities"""

teststr = '#Test\n[RecentsMRL]\nlist=C:\\Users\\me\\Videos\\movie.mpg,C:\\Users\\me\\movie2.mpg\n\n'
teststr = b'#Test\n[RecentsMRL]\nlist=C:\\Users\\me\\Videos\\movie.mpg,C:\\Users\\me\\movie2.mpg\n\n'
# create test file
filename = self.write_file('bleachbit-test-ini', teststr)
self.assertExists(filename)
Expand Down
4 changes: 2 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def write_file(self, filename, contents=''):
"""Create a temporary file, optionally writing contents to it"""
if not os.path.isabs(filename):
filename = os.path.join(self.tempdir, filename)
filename = extended_path(filename)
with open(filename, 'w') as f:
#filename = extended_path(filename)
with open(filename, 'wb') as f:
f.write(contents)
assert (os.path.exists(filename))
return filename
Expand Down

0 comments on commit 1bc6410

Please sign in to comment.