Drop WorkbenchManager.localized_file()
As Workbench has the localized_file() method, use this everywhere and drop the wrapper method from WorkbenchManager. The processing code already did that.
This commit is contained in:
parent
52426ae01f
commit
8bfa533f8b
@ -83,20 +83,19 @@ class TestWorkbench(object):
|
|||||||
with this_storage.get_file(filepath, 'w') as our_file:
|
with this_storage.get_file(filepath, 'w') as our_file:
|
||||||
our_file.write('Our file')
|
our_file.write('Our file')
|
||||||
|
|
||||||
filename = self.workbench_manager.localized_file(
|
filename = this_workbench.localized_file(this_storage, filepath)
|
||||||
this_workbench, this_storage, filepath)
|
|
||||||
assert filename == os.path.join(
|
assert filename == os.path.join(
|
||||||
this_workbench.dir, 'ourfile.txt')
|
this_workbench.dir, 'ourfile.txt')
|
||||||
|
|
||||||
# fake remote file storage, filename_if_copying set
|
# fake remote file storage, filename_if_copying set
|
||||||
filename = self.workbench_manager.localized_file(
|
filename = this_workbench.localized_file(
|
||||||
this_workbench, this_storage, filepath, 'thisfile')
|
this_storage, filepath, 'thisfile')
|
||||||
assert filename == os.path.join(
|
assert filename == os.path.join(
|
||||||
this_workbench.dir, 'thisfile.txt')
|
this_workbench.dir, 'thisfile.txt')
|
||||||
|
|
||||||
# fake remote file storage, filename_if_copying set,
|
# fake remote file storage, filename_if_copying set,
|
||||||
# keep_extension_if_copying set to false
|
# keep_extension_if_copying set to false
|
||||||
filename = self.workbench_manager.localized_file(
|
filename = this_workbench.localized_file(
|
||||||
this_workbench, this_storage, filepath, 'thisfile.text', False)
|
this_storage, filepath, 'thisfile.text', False)
|
||||||
assert filename == os.path.join(
|
assert filename == os.path.join(
|
||||||
this_workbench.dir, 'thisfile.text')
|
this_workbench.dir, 'thisfile.text')
|
||||||
|
@ -151,6 +151,3 @@ class WorkbenchManager(object):
|
|||||||
"Can't destroy workbench outside the base workbench dir")
|
"Can't destroy workbench outside the base workbench dir")
|
||||||
|
|
||||||
shutil.rmtree(workbench)
|
shutil.rmtree(workbench)
|
||||||
|
|
||||||
def localized_file(self, workbench, *args, **kwargs):
|
|
||||||
return workbench.localized_file(*args, **kwargs)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user