Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Commit

Permalink
line length
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianvf committed Jul 23, 2019
1 parent 938ba98 commit 6299e29
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions dynamic/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_cluster_custom_resources(self):
client = DynamicClient(api_client.ApiClient(configuration=self.config))

with self.assertRaises(ResourceNotFoundError):
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ClusterChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ClusterChangeMe')

crd_api = client.resources.get(kind='CustomResourceDefinition')
name = 'clusterchangemes.apps.example.com'
Expand Down Expand Up @@ -77,11 +78,13 @@ def test_cluster_custom_resources(self):
self.assertTrue(resp.status)

try:
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ClusterChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ClusterChangeMe')
except ResourceNotFoundError:
# Sometimes need to wait a sec for the discovery layer to get updated
# Need to wait a sec for the discovery layer to get updated
time.sleep(2)
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ClusterChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ClusterChangeMe')
resp = changeme_api.get()
self.assertEqual(resp.items, [])
changeme_name = 'custom-resource' + short_uuid()
Expand Down Expand Up @@ -127,13 +130,15 @@ def test_cluster_custom_resources(self):
time.sleep(2)
client.resources.invalidate_cache()
with self.assertRaises(ResourceNotFoundError):
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ClusterChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ClusterChangeMe')

def test_namespaced_custom_resources(self):
client = DynamicClient(api_client.ApiClient(configuration=self.config))

with self.assertRaises(ResourceNotFoundError):
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ChangeMe')

crd_api = client.resources.get(kind='CustomResourceDefinition')
name = 'changemes.apps.example.com'
Expand Down Expand Up @@ -170,11 +175,13 @@ def test_namespaced_custom_resources(self):
self.assertTrue(resp.status)

try:
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ChangeMe')
except ResourceNotFoundError:
# Sometimes need to wait a sec for the discovery layer to get updated
# Need to wait a sec for the discovery layer to get updated
time.sleep(2)
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ChangeMe')
resp = changeme_api.get()
self.assertEqual(resp.items, [])
changeme_name = 'custom-resource' + short_uuid()
Expand Down Expand Up @@ -228,7 +235,8 @@ def test_namespaced_custom_resources(self):
time.sleep(2)
client.resources.invalidate_cache()
with self.assertRaises(ResourceNotFoundError):
changeme_api = client.resources.get(api_version='apps.example.com/v1', kind='ChangeMe')
changeme_api = client.resources.get(
api_version='apps.example.com/v1', kind='ChangeMe')

def test_service_apis(self):
client = DynamicClient(api_client.ApiClient(configuration=self.config))
Expand Down Expand Up @@ -279,7 +287,8 @@ def test_service_apis(self):

def test_replication_controller_apis(self):
client = DynamicClient(api_client.ApiClient(configuration=self.config))
api = client.resources.get(api_version='v1', kind='ReplicationController')
api = client.resources.get(
api_version='v1', kind='ReplicationController')

name = 'frontend-' + short_uuid()
rc_manifest = {
Expand Down Expand Up @@ -323,7 +332,7 @@ def test_configmap_apis(self):
},
"data": {
"config.json": "{\"command\":\"/usr/bin/mysqld_safe\"}",
"frontend.cnf": "[mysqld]\nbind-address = 10.0.0.3\nport = 3306\n"
"frontend.cnf": "[mysqld]\nbind-address = 10.0.0.3\n"
}
}

Expand Down

0 comments on commit 6299e29

Please sign in to comment.