-
Notifications
You must be signed in to change notification settings - Fork 276
Conversation
Adding the ability to get a list of networks via the api and tests to verify data.
Re made the fake responses to work with pagenation.
Changed get_networks from beta to v1, removed the subnetworks test.
Forgot to remove the fake data for the subnetworks before last push.
Codecov Report
@@ Coverage Diff @@
## dev #677 +/- ##
=========================================
+ Coverage 83.7% 83.72% +0.02%
=========================================
Files 165 165
Lines 8359 8370 +11
=========================================
+ Hits 6997 7008 +11
Misses 1362 1362
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
"kind": "compute#network", | ||
"id": "1234", | ||
"creationTimestamp": "2017-09-25T12:41:09.416-07:00", | ||
"name": "default2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: name should match selflink, change from default2 to thisisatest and update the expected names below.
@@ -194,6 +195,16 @@ def firewalls(self): | |||
return self._firewalls | |||
|
|||
@property | |||
def networks(self): | |||
"""Returns a _ComputeNetworksRepository instance.""" | |||
# The beta api provides more complete gcp networks data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Comment is out of date, no longer needed with the change back to v1.
@@ -117,6 +117,17 @@ def test_get_firewall_rules_errors(self, name, response, status, | |||
with self.assertRaises(expected_exception): | |||
list(self.gce_api_client.get_firewall_rules(self.project_id)) | |||
|
|||
def test_get_networks(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for the error cases as well, like test_get_firewall_rules_errors above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
Added the test_get_network_errors test to verify error condidtions for get networks
Thanks for opening a Pull Request!
Here's a handy checklist to ensure your PR goes smoothly.
pylint --rcfile=pylintrc
passes.These guidelines and more can be found in our contributing guidelines.