Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shadowed builtins, id -> id_ #533

Merged
merged 1 commit into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions examples/whitelabel/whitelabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
data = {
"ip": "192.168.0.1"
}
id = "test_url_param"
response = sg.client.whitelabel.domains._(id).ips.post(request_body=data)
id_ = "test_url_param"
response = sg.client.whitelabel.domains._(id_).ips.post(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -127,9 +127,9 @@
# Remove an IP from a domain whitelabel. #
# DELETE /whitelabel/domains/{id}/ips/{ip} #

id = "test_url_param"
id_ = "test_url_param"
ip = "test_url_param"
response = sg.client.whitelabel.domains._(id).ips._(ip).delete()
response = sg.client.whitelabel.domains._(id_).ips._(ip).delete()
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -138,8 +138,8 @@
# Validate a domain whitelabel. #
# POST /whitelabel/domains/{id}/validate #

id = "test_url_param"
response = sg.client.whitelabel.domains._(id).validate.post()
id_ = "test_url_param"
response = sg.client.whitelabel.domains._(id_).validate.post()
print(response.status_code)
print(response.body)
print(response.headers)
Expand Down Expand Up @@ -172,8 +172,8 @@
# Retrieve an IP whitelabel #
# GET /whitelabel/ips/{id} #

id = "test_url_param"
response = sg.client.whitelabel.ips._(id).get()
id_ = "test_url_param"
response = sg.client.whitelabel.ips._(id_).get()
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -182,8 +182,8 @@
# Delete an IP whitelabel #
# DELETE /whitelabel/ips/{id} #

id = "test_url_param"
response = sg.client.whitelabel.ips._(id).delete()
id_ = "test_url_param"
response = sg.client.whitelabel.ips._(id_).delete()
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -192,8 +192,8 @@
# Validate an IP whitelabel #
# POST /whitelabel/ips/{id}/validate #

id = "test_url_param"
response = sg.client.whitelabel.ips._(id).validate.post()
id_ = "test_url_param"
response = sg.client.whitelabel.ips._(id_).validate.post()
print(response.status_code)
print(response.body)
print(response.headers)
Expand Down Expand Up @@ -260,8 +260,8 @@
data = {
"default": True
}
id = "test_url_param"
response = sg.client.whitelabel.links._(id).patch(request_body=data)
id_ = "test_url_param"
response = sg.client.whitelabel.links._(id_).patch(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -270,8 +270,8 @@
# Retrieve a Link Whitelabel #
# GET /whitelabel/links/{id} #

id = "test_url_param"
response = sg.client.whitelabel.links._(id).get()
id_ = "test_url_param"
response = sg.client.whitelabel.links._(id_).get()
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -280,8 +280,8 @@
# Delete a Link Whitelabel #
# DELETE /whitelabel/links/{id} #

id = "test_url_param"
response = sg.client.whitelabel.links._(id).delete()
id_ = "test_url_param"
response = sg.client.whitelabel.links._(id_).delete()
print(response.status_code)
print(response.body)
print(response.headers)
Expand All @@ -290,8 +290,8 @@
# Validate a Link Whitelabel #
# POST /whitelabel/links/{id}/validate #

id = "test_url_param"
response = sg.client.whitelabel.links._(id).validate.post()
id_ = "test_url_param"
response = sg.client.whitelabel.links._(id_).validate.post()
print(response.status_code)
print(response.body)
print(response.headers)
Expand Down
40 changes: 20 additions & 20 deletions test/test_sendgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2227,25 +2227,25 @@ def test_whitelabel_domains__id__ips_post(self):
data = {
"ip": "192.168.0.1"
}
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.domains._(
id).ips.post(request_body=data, request_headers=headers)
id_).ips.post(request_body=data, request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_domains__id__ips__ip__delete(self):
id = "test_url_param"
id_ = "test_url_param"
ip = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.domains._(
id).ips._(ip).delete(request_headers=headers)
id_).ips._(ip).delete(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_domains__id__validate_post(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.domains._(
id).validate.post(request_headers=headers)
id_).validate.post(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_ips_post(self):
Expand All @@ -2267,24 +2267,24 @@ def test_whitelabel_ips_get(self):
self.assertEqual(response.status_code, 200)

def test_whitelabel_ips__id__get(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.ips._(
id).get(request_headers=headers)
id_).get(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_ips__id__delete(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 204}
response = self.sg.client.whitelabel.ips._(
id).delete(request_headers=headers)
id_).delete(request_headers=headers)
self.assertEqual(response.status_code, 204)

def test_whitelabel_ips__id__validate_post(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.ips._(
id).validate.post(request_headers=headers)
id_).validate.post(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_links_post(self):
Expand Down Expand Up @@ -2331,31 +2331,31 @@ def test_whitelabel_links__id__patch(self):
data = {
"default": True
}
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.links._(id).patch(
response = self.sg.client.whitelabel.links._(id_).patch(
request_body=data, request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_links__id__get(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.links._(
id).get(request_headers=headers)
id_).get(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_links__id__delete(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 204}
response = self.sg.client.whitelabel.links._(
id).delete(request_headers=headers)
id_).delete(request_headers=headers)
self.assertEqual(response.status_code, 204)

def test_whitelabel_links__id__validate_post(self):
id = "test_url_param"
id_ = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.whitelabel.links._(
id).validate.post(request_headers=headers)
id_).validate.post(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_whitelabel_links__link_id__subuser_post(self):
Expand Down