-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1569 from allmightyspiff/issues1568
fixed up snapshot-notification cli commands
- Loading branch information
Showing
8 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
SoftLayer.tests.managers.storage_generic_tests | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
|
||
import SoftLayer | ||
from SoftLayer import testing | ||
|
||
|
||
class StorageGenericTests(testing.TestCase): | ||
def set_up(self): | ||
self.storage = SoftLayer.managers.storage.StorageManager(self.client) | ||
|
||
def test_get_volume_snapshot_notification_status(self): | ||
mock = self.set_mock('SoftLayer_Network_Storage', 'getSnapshotNotificationStatus') | ||
# These are the values we expect from the API as of 2021-12-01, FBLOCK4193 | ||
mock.side_effect = [None, '1', '0'] | ||
expected = [1, 1, 0] | ||
|
||
for expect in expected: | ||
result = self.storage.get_volume_snapshot_notification_status(12345) | ||
self.assert_called_with('SoftLayer_Network_Storage', 'getSnapshotNotificationStatus', identifier=12345) | ||
self.assertEqual(expect, result) | ||
|
||
def test_set_volume_snapshot_notification(self): | ||
mock = self.set_mock('SoftLayer_Network_Storage', 'setSnapshotNotification') | ||
mock.return_value = None | ||
|
||
result = self.storage.set_volume_snapshot_notification(12345, False) | ||
self.assert_called_with('SoftLayer_Network_Storage', 'setSnapshotNotification', | ||
identifier=12345, args=(False,)) | ||
self.assertEqual(None, result) |