测试创建容器 @return:
(self)
| 76 | self.assertIsInstance(dc.main().get_list(get), dict) |
| 77 | |
| 78 | def test_run(self): |
| 79 | """ |
| 80 | 测试创建容器 |
| 81 | @return: |
| 82 | """ |
| 83 | get = TestParamManage().get_dict_obj() |
| 84 | get.image = 'nginx:latest' |
| 85 | get.name = 'test_{}'.format(random.randint(10000, 65535)) |
| 86 | get.port = {"80/tcp": format(random.randint(10000, 65535))} |
| 87 | get.volumes = {"/www/wwwroot/test": {"bind": "/usr/share/nginx/html", "mode": "rw"}} |
| 88 | get.environment = '' |
| 89 | get.labels = '' |
| 90 | get.network = '' |
| 91 | get.cpu_quota = 0 |
| 92 | self.assertEqual(dc.main().run(get), {"status": True, "msg": "容器创建成功!"}) |
| 93 | |
| 94 | def test_run_cmd(self): |
| 95 | ''' |
nothing calls this directly
no test coverage detected