(self)
| 520 | namespace='default') |
| 521 | |
| 522 | def test_service_apis(self): |
| 523 | client = api_client.ApiClient(configuration=self.config) |
| 524 | api = core_v1_api.CoreV1Api(client) |
| 525 | |
| 526 | name = 'frontend-' + short_uuid() |
| 527 | service_manifest = {'apiVersion': 'v1', |
| 528 | 'kind': 'Service', |
| 529 | 'metadata': {'labels': {'name': name}, |
| 530 | 'name': name, |
| 531 | 'resourceversion': 'v1'}, |
| 532 | 'spec': {'ports': [{'name': 'port', |
| 533 | 'port': 80, |
| 534 | 'protocol': 'TCP', |
| 535 | 'targetPort': 80}], |
| 536 | 'selector': {'name': name}}} |
| 537 | |
| 538 | resp = api.create_namespaced_service(body=service_manifest, |
| 539 | namespace='default') |
| 540 | self.assertEqual(name, resp.metadata.name) |
| 541 | self.assertTrue(resp.status) |
| 542 | |
| 543 | resp = api.read_namespaced_service(name=name, |
| 544 | namespace='default') |
| 545 | self.assertEqual(name, resp.metadata.name) |
| 546 | self.assertTrue(resp.status) |
| 547 | |
| 548 | service_manifest['spec']['ports'] = [{'name': 'new', |
| 549 | 'port': 8080, |
| 550 | 'protocol': 'TCP', |
| 551 | 'targetPort': 8080}] |
| 552 | resp = api.patch_namespaced_service(body=service_manifest, |
| 553 | name=name, |
| 554 | namespace='default') |
| 555 | self.assertEqual(2, len(resp.spec.ports)) |
| 556 | self.assertTrue(resp.status) |
| 557 | |
| 558 | resp = api.delete_namespaced_service(name=name, body={}, |
| 559 | namespace='default') |
| 560 | |
| 561 | def test_replication_controller_apis(self): |
| 562 | client = api_client.ApiClient(configuration=self.config) |
nothing calls this directly
no test coverage detected