Skip to content

Commit 8dd2ddb

Browse files
Merge pull request #1175 from caberos/unittest_autoscale
unit test logs and scale
2 parents 63de0ad + 3dcf3f6 commit 8dd2ddb

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

SoftLayer/fixtures/SoftLayer_Scale_Group.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
"maximumMemberCount": 5,
5151
"minimumMemberCount": 0,
5252
"name": "tests",
53+
"virtualGuest": {
54+
"accountId": 31111,
55+
"createDate": "2019-10-02T15:24:54-06:00",
56+
"billingItem": {
57+
"cancellationDate": "2019-10-02T08:34:21-06:00"}
58+
},
5359
"virtualGuestMemberTemplate": {
5460
"accountId": 31111,
5561
"domain": "sodg.com",
@@ -89,6 +95,12 @@
8995
"minimumMemberCount": 0,
9096
"modifyDate": "2019-01-19T04:53:21+08:00",
9197
"name": "test-ajcb",
98+
"virtualGuest": {
99+
"accountId": 31111,
100+
"createDate": "2019-10-02T15:24:54-06:00",
101+
"billingItem": {
102+
"cancellationDate": "2019-10-02T08:34:21-06:00"}
103+
},
92104
"virtualGuestMemberTemplate": {
93105
"accountId": 31111,
94106
"domain": "test.local",
@@ -120,7 +132,7 @@
120132
},
121133
"virtualGuestAssets": [],
122134
"virtualGuestMembers": []
123-
},
135+
}
124136
]
125137

126138
scaleTo = [
@@ -134,6 +146,8 @@
134146
"minimumMemberCount": 0,
135147
"name": "tests",
136148
"regionalGroupId": 663,
149+
"virtualGuest": {
150+
},
137151
"virtualGuestMemberTemplate": {
138152
"accountId": 31111,
139153
"domain": "sodg.com",
@@ -169,6 +183,12 @@
169183
"modifyDate": "2019-01-19T04:53:21+08:00",
170184
"name": "test-ajcb",
171185
"regionalGroupId": 1025,
186+
"virtualGuest": {
187+
"accountId": 31111,
188+
"createDate": "2019-10-02T15:24:54-06:00",
189+
"billingItem": {
190+
"cancellationDate": "2019-10-02T08:34:21-06:00"}
191+
},
172192
"virtualGuestMemberTemplate": {
173193
"accountId": 31111,
174194
"domain": "test.local",

tests/CLI/modules/autoscale_tests.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
11
"""
22
SoftLayer.tests.CLI.modules.autoscale_tests
3+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
:license: MIT, see LICENSE for more details.
36
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47
58
Tests for the user cli command
69
"""
710
from SoftLayer import testing
811

912

10-
class AutoScaleTests(testing.TestCase):
13+
class AutoscaleTests(testing.TestCase):
14+
15+
def test_logs_dates(self):
16+
result = self.run_command(['autoscale', 'logs', '123456', '-d', '2019-02-02'])
17+
print(result)
18+
self.assert_no_fail(result)
19+
20+
def test_scale_down(self):
21+
result = self.run_command(['autoscale', 'scale', '123456', '--down', '--amount', '2'])
22+
self.assert_no_fail(result)
23+
24+
def test_scale_up(self):
25+
result = self.run_command(['autoscale', 'scale', '123456', '--up', '--amount', '2'])
26+
self.assert_no_fail(result)
27+
28+
def test_scale_to(self):
29+
result = self.run_command(['autoscale', 'scale', '789654123', '--down', '--amount', '2'])
30+
self.assert_no_fail(result)
31+
32+
def test_scale_by_up(self):
33+
result = self.run_command(['autoscale', 'scale', '789654123', '--by', '--down', '--amount', '-1'])
34+
self.assert_no_fail(result)
35+
36+
def test_scale_cancel(self):
37+
result = self.run_command(['autoscale', 'scale', '789654123', '--by', '--down', '--amount', '1'])
38+
self.assert_no_fail(result)
1139

1240
def test_autoscale_list(self):
1341
result = self.run_command(['autoscale', 'list'])

0 commit comments

Comments
 (0)