(self)
| 28 | self.tmp_configs = [] |
| 29 | |
| 30 | def tearDown(self): |
| 31 | client = docker.from_env(version=TEST_API_VERSION) |
| 32 | try: |
| 33 | for img in self.tmp_imgs: |
| 34 | try: |
| 35 | client.api.remove_image(img) |
| 36 | except docker.errors.APIError: |
| 37 | pass |
| 38 | for container in self.tmp_containers: |
| 39 | try: |
| 40 | client.api.remove_container(container, force=True, v=True) |
| 41 | except docker.errors.APIError: |
| 42 | pass |
| 43 | for network in self.tmp_networks: |
| 44 | try: |
| 45 | client.api.remove_network(network) |
| 46 | except docker.errors.APIError: |
| 47 | pass |
| 48 | for volume in self.tmp_volumes: |
| 49 | try: |
| 50 | client.api.remove_volume(volume) |
| 51 | except docker.errors.APIError: |
| 52 | pass |
| 53 | |
| 54 | for secret in self.tmp_secrets: |
| 55 | try: |
| 56 | client.api.remove_secret(secret) |
| 57 | except docker.errors.APIError: |
| 58 | pass |
| 59 | |
| 60 | for config in self.tmp_configs: |
| 61 | try: |
| 62 | client.api.remove_config(config) |
| 63 | except docker.errors.APIError: |
| 64 | pass |
| 65 | |
| 66 | for folder in self.tmp_folders: |
| 67 | shutil.rmtree(folder) |
| 68 | finally: |
| 69 | client.close() |
| 70 | |
| 71 | |
| 72 | class BaseAPIIntegrationTest(BaseIntegrationTest): |
no test coverage detected