MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / test_run

Method test_run

class/btdockerModel/test/containerModelTest.py:78–92  ·  view source on GitHub ↗

测试创建容器 @return:

(self)

Source from the content-addressed store, hash-verified

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 '''

Callers

nothing calls this directly

Calls 5

TestParamManageClass · 0.85
get_dict_objMethod · 0.80
formatMethod · 0.45
runMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected