Skip to content

Commit

Permalink
fix unittest issues
Browse files Browse the repository at this point in the history
Chage tests to call SaveRestoreManager
  • Loading branch information
ayeleta committed Apr 7, 2017
1 parent e568aaf commit a07a839
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def tearDown(self):

@patch('cloudshell.helpers.scripts.cloudshell_scripts_helpers.get_api_session')
@patch('sandbox_scripts.environment.setup.setup_resources.SandboxBase')
@patch('sandbox_scripts.environment.setup.setup_resources.NetworkingSaveRestore')
@patch('sandbox_scripts.environment.setup.setup_resources.SaveRestoreManager')
def test_flow_ok_with_snapshots(self, mock_save, mock_sandboxbase, mock_api_session):

mock_save.return_value.is_snapshot.return_value = True
Expand All @@ -48,7 +48,7 @@ def test_flow_ok_with_snapshots(self, mock_save, mock_sandboxbase, mock_api_sess

@patch('cloudshell.helpers.scripts.cloudshell_scripts_helpers.get_api_session')
@patch('sandbox_scripts.environment.setup.setup_resources.SandboxBase')
@patch('sandbox_scripts.environment.setup.setup_resources.NetworkingSaveRestore')
@patch('sandbox_scripts.environment.setup.setup_resources.SaveRestoreManager')
def test_flow_ok_with_gold(self, mock_save, mock_sandboxbase, mock_api_session):
mock_save.return_value.is_snapshot.return_value = False
mock_sandboxbase.return_value.get_storage_server_resource.return_value = True
Expand All @@ -63,7 +63,7 @@ def test_flow_ok_with_gold(self, mock_save, mock_sandboxbase, mock_api_session):

@patch('cloudshell.helpers.scripts.cloudshell_scripts_helpers.get_api_session')
@patch('sandbox_scripts.environment.setup.setup_resources.SandboxBase')
@patch('sandbox_scripts.environment.setup.setup_resources.NetworkingSaveRestore')
@patch('sandbox_scripts.environment.setup.setup_resources.SaveRestoreManager')
def test_flow_ok_with_no_storage_device(self, mock_save, mock_sandboxbase, mock_api_session):
mock_sandboxbase.return_value.get_storage_server_resource.return_value = False
self.setup_script.execute()
Expand Down
3 changes: 1 addition & 2 deletions sandbox_scripts/helpers/Networking/NetworkingSaveNRestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from sandbox_scripts.QualiEnvironmentUtils.ConfigPoolManager import *
# from sandbox_scripts.QualiEnvironmentUtils.StorageManager import StorageManager
from sandbox_scripts.helpers.Networking.base_save_restore import *
from QualiUtils import QualiError

from sandbox_scripts.QualiEnvironmentUtils.QualiUtils import QualiError

class NetworkingSaveRestore(object):
def __init__(self, sandbox):
Expand Down
2 changes: 1 addition & 1 deletion sandbox_scripts/helpers/Networking/vm_save_restore.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from sandbox_scripts.helpers.Networking.base_save_restore import *
from QualiUtils import QualiError
from sandbox_scripts.QualiEnvironmentUtils.QualiUtils import QualiError
from multiprocessing.pool import ThreadPool
from threading import Lock

Expand Down

0 comments on commit a07a839

Please sign in to comment.