libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [libcloud] Kami commented on a change in pull request #1437: Implement g8 provider for libcloud
Date Sat, 07 Mar 2020 20:37:52 GMT
Kami commented on a change in pull request #1437: Implement g8 provider for libcloud
URL: https://github.com/apache/libcloud/pull/1437#discussion_r389310469
 
 

 ##########
 File path: libcloud/test/compute/test_gig_g8.py
 ##########
 @@ -0,0 +1,151 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import sys
+import unittest
+
+from libcloud.utils.py3 import httplib
+from libcloud.test import MockHttp
+from libcloud.compute.base import NodeImage, NodeSize, Node, StorageVolume
+from libcloud.compute.drivers.gig_g8 import G8NodeDriver, G8Network, G8PortForward
+from libcloud.test.file_fixtures import ComputeFileFixtures
+
+
+class G8MockHttp(MockHttp):
+    """Fixtures needed for tests related to rating model"""
+    fixtures = ComputeFileFixtures('gig_g8')
+
+    def __getattr__(self, key):
+        def method(method, path, params, headers):
+            response = self.fixtures.load('{}.json'.format(key.lstrip("_")))
 
 Review comment:
   I know a lot of existing test cases don't do that, but it's also preferred to check HTTP
method as well (perhaps you could add it to the filename, e.g. ``POST_machines_create.json``
or similar.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message