Fixed jasmine and API test cases for import/export servers.

This commit is contained in:
Nikhil Mohite
2023-03-28 22:19:01 +05:30
committed by GitHub
parent e797eb17eb
commit 05f3efbc97
2 changed files with 8 additions and 2 deletions

View File

@@ -272,8 +272,12 @@ def filename_with_file_manager_path(_file, create_file=False,
Filename to use for backup with full path taken from preference
"""
# retrieve storage directory path
last_storage = Preferences.module('file_manager').preference(
'last_storage').get()
try:
last_storage = Preferences.module('file_manager').preference(
'last_storage').get()
except Exception as e:
last_storage = MY_STORAGE
if last_storage != MY_STORAGE:
selDirList = [sdir for sdir in current_app.config['SHARED_STORAGE']
if sdir['name'] == last_storage]

View File

@@ -158,6 +158,7 @@ describe('FileManger', ()=>{
it('Change Shared Storage', (done)=>{
networkMock.onPost('/file_manager/init').reply(200, {'data': configData});
networkMock.onPost(`/file_manager/save_last_dir/${transId}`).reply(200, {'success':1,'errormsg':'','info':'','result':null,'data':null});
let ctrl = ctrlMount({});
setTimeout(()=>{
ctrl.update();
@@ -171,6 +172,7 @@ describe('FileManger', ()=>{
it('Change Storage to My Storage', (done)=>{
networkMock.onPost('/file_manager/init').reply(200, {'data': configData});
networkMock.onPost(`/file_manager/save_last_dir/${transId}`).reply(200, {'success':1,'errormsg':'','info':'','result':null,'data':null});
let ctrl = ctrlMount({});
setTimeout(()=>{
ctrl.update();