Repository: softlayer/softlayer-python
Pull request #1175 (2019-10-03 19:57:37)

unit test logs and scale
unit test autoscale 
class Logs scale


Patch:
diff --git a/SoftLayer/fixtures/SoftLayer_Scale_Group.py b/SoftLayer/fixtures/SoftLayer_Scale_Group.py
index 403bd520..afaaf118 100644
--- a/SoftLayer/fixtures/SoftLayer_Scale_Group.py
+++ b/SoftLayer/fixtures/SoftLayer_Scale_Group.py
@@ -50,6 +50,12 @@
         "maximumMemberCount": 5,
         "minimumMemberCount": 0,
         "name": "tests",
+        "virtualGuest": {
+            "accountId": 31111,
+            "createDate": "2019-10-02T15:24:54-06:00",
+            "billingItem": {
+                "cancellationDate": "2019-10-02T08:34:21-06:00"}
+        },
         "virtualGuestMemberTemplate": {
             "accountId": 31111,
             "domain": "sodg.com",
@@ -89,6 +95,12 @@
         "minimumMemberCount": 0,
         "modifyDate": "2019-01-19T04:53:21+08:00",
         "name": "test-ajcb",
+        "virtualGuest": {
+            "accountId": 31111,
+            "createDate": "2019-10-02T15:24:54-06:00",
+            "billingItem": {
+                "cancellationDate": "2019-10-02T08:34:21-06:00"}
+        },
         "virtualGuestMemberTemplate": {
             "accountId": 31111,
             "domain": "test.local",
@@ -120,7 +132,7 @@
         },
         "virtualGuestAssets": [],
         "virtualGuestMembers": []
-    },
+    }
 ]
 
 scaleTo = [
@@ -134,6 +146,8 @@
         "minimumMemberCount": 0,
         "name": "tests",
         "regionalGroupId": 663,
+        "virtualGuest": {
+        },
         "virtualGuestMemberTemplate": {
             "accountId": 31111,
             "domain": "sodg.com",
@@ -169,6 +183,12 @@
         "modifyDate": "2019-01-19T04:53:21+08:00",
         "name": "test-ajcb",
         "regionalGroupId": 1025,
+        "virtualGuest": {
+            "accountId": 31111,
+            "createDate": "2019-10-02T15:24:54-06:00",
+            "billingItem": {
+                "cancellationDate": "2019-10-02T08:34:21-06:00"}
+        },
         "virtualGuestMemberTemplate": {
             "accountId": 31111,
             "domain": "test.local",


Test patch:
diff --git a/tests/CLI/modules/autoscale_tests.py b/tests/CLI/modules/autoscale_tests.py
index 33bf4a37..b3d7293c 100644
--- a/tests/CLI/modules/autoscale_tests.py
+++ b/tests/CLI/modules/autoscale_tests.py
@@ -1,5 +1,8 @@
 """
     SoftLayer.tests.CLI.modules.autoscale_tests
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    :license: MIT, see LICENSE for more details.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Tests for the user cli command
@@ -7,7 +10,32 @@
 from SoftLayer import testing
 
 
-class AutoScaleTests(testing.TestCase):
+class AutoscaleTests(testing.TestCase):
+
+    def test_logs_dates(self):
+        result = self.run_command(['autoscale', 'logs', '123456', '-d', '2019-02-02'])
+        print(result)
+        self.assert_no_fail(result)
+
+    def test_scale_down(self):
+        result = self.run_command(['autoscale', 'scale', '123456', '--down', '--amount', '2'])
+        self.assert_no_fail(result)
+
+    def test_scale_up(self):
+        result = self.run_command(['autoscale', 'scale', '123456', '--up', '--amount', '2'])
+        self.assert_no_fail(result)
+
+    def test_scale_to(self):
+        result = self.run_command(['autoscale', 'scale', '789654123', '--down', '--amount', '2'])
+        self.assert_no_fail(result)
+
+    def test_scale_by_up(self):
+        result = self.run_command(['autoscale', 'scale', '789654123', '--by', '--down', '--amount', '-1'])
+        self.assert_no_fail(result)
+
+    def test_scale_cancel(self):
+        result = self.run_command(['autoscale', 'scale', '789654123', '--by', '--down', '--amount', '1'])
+        self.assert_no_fail(result)
 
     def test_autoscale_list(self):
         result = self.run_command(['autoscale', 'list'])