Skip to content

Commit 59df285

Browse files
committed
resolve ut errors
1 parent 5455403 commit 59df285

5 files changed

Lines changed: 12 additions & 3 deletions

File tree

cterasdk/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
settings = fromjsonstr(json.dumps(yaml.safe_load(f)))
2323

2424

25-
core, edge, io, audit = settings.core, settings.edge, settings.io, settings.audit
25+
core, edge, drive, io, audit = settings.core, settings.edge, settings.drive, settings.io, settings.audit

tests/ut/aio/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
class BaseAsyncTest(unittest.IsolatedAsyncioTestCase):
66
"""Base Async Test"""
77

8+
def setUp(self):
9+
super().setUp()
10+
self.patch_call('asyncio.get_running_loop')
11+
812
def patch_call(self, module_path, **patch_kwargs):
913
return utilities.patch_call(self, module_path, **patch_kwargs)
1014

tests/ut/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
class BaseTest(unittest.TestCase):
66

7+
def setUp(self):
8+
super().setUp()
9+
self.patch_call('asyncio.get_running_loop')
10+
711
def patch_call(self, module_path, **patch_kwargs):
812
return utilities.patch_call(self, module_path, **patch_kwargs)
913

tests/ut/edge/test_ssh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_enable_no_public_key(self):
3737
def test_enable_public_key_from_file(self):
3838
response = 'PublicKey'
3939
self._init_filer()
40-
self.patch_call('cterasdk.edge.ssh.FileSystem.properties')
40+
self.patch_call('cterasdk.edge.ssh.commonfs.properties')
4141
with mock.patch("builtins.open", mock.mock_open(read_data=response)):
4242
ssh.SSH(self._filer).enable(public_key_file=self._public_key_file)
4343
self._filer.api.execute.assert_called_once_with('/config/device', 'startSSHD', mock.ANY)

tests/ut/edge/test_support.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import datetime
22

3+
from pathlib import Path
34
from freezegun import freeze_time
45

56
from cterasdk import exceptions
@@ -36,4 +37,4 @@ def test_get_support_report(self):
3637
support.Support(self._filer).get_support_report()
3738
self._filer.api.handle.assert_called_once_with('/supportreport')
3839
filename = 'Support-' + current_datetime.strftime('_%Y-%m-%dT%H_%M_%S') + '.zip'
39-
mock_save_file.assert_called_once_with(cterasdk.settings.io.downloads, filename, handle_response)
40+
mock_save_file.assert_called_once_with(Path(cterasdk.settings.io.downloads).expanduser(), filename, handle_response)

0 commit comments

Comments
 (0)