mirror of https://github.com/docker/compose.git
function-name-modification for tests/*
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
This commit is contained in:
parent
40c26ca676
commit
d20e3f3342
|
@ -1234,7 +1234,7 @@ class CLITestCase(DockerClientTestCase):
|
||||||
container = service.containers(stopped=True, one_off=OneOffFilter.only)[0]
|
container = service.containers(stopped=True, one_off=OneOffFilter.only)[0]
|
||||||
self.assertEqual(user, container.get('Config.User'))
|
self.assertEqual(user, container.get('Config.User'))
|
||||||
|
|
||||||
def test_run_service_with_environement_overridden(self):
|
def test_run_service_with_environment_overridden(self):
|
||||||
name = 'service'
|
name = 'service'
|
||||||
self.base_dir = 'tests/fixtures/environment-composefile'
|
self.base_dir = 'tests/fixtures/environment-composefile'
|
||||||
self.dispatch([
|
self.dispatch([
|
||||||
|
@ -1246,9 +1246,9 @@ class CLITestCase(DockerClientTestCase):
|
||||||
])
|
])
|
||||||
service = self.project.get_service(name)
|
service = self.project.get_service(name)
|
||||||
container = service.containers(stopped=True, one_off=OneOffFilter.only)[0]
|
container = service.containers(stopped=True, one_off=OneOffFilter.only)[0]
|
||||||
# env overriden
|
# env overridden
|
||||||
self.assertEqual('notbar', container.environment['foo'])
|
self.assertEqual('notbar', container.environment['foo'])
|
||||||
# keep environement from yaml
|
# keep environment from yaml
|
||||||
self.assertEqual('world', container.environment['hello'])
|
self.assertEqual('world', container.environment['hello'])
|
||||||
# added option from command line
|
# added option from command line
|
||||||
self.assertEqual('beta', container.environment['alpha'])
|
self.assertEqual('beta', container.environment['alpha'])
|
||||||
|
@ -1293,7 +1293,7 @@ class CLITestCase(DockerClientTestCase):
|
||||||
self.assertEqual(port_range[0], "0.0.0.0:49153")
|
self.assertEqual(port_range[0], "0.0.0.0:49153")
|
||||||
self.assertEqual(port_range[1], "0.0.0.0:49154")
|
self.assertEqual(port_range[1], "0.0.0.0:49154")
|
||||||
|
|
||||||
def test_run_service_with_explicitly_maped_ports(self):
|
def test_run_service_with_explicitly_mapped_ports(self):
|
||||||
# create one off container
|
# create one off container
|
||||||
self.base_dir = 'tests/fixtures/ports-composefile'
|
self.base_dir = 'tests/fixtures/ports-composefile'
|
||||||
self.dispatch(['run', '-d', '-p', '30000:3000', '--publish', '30001:3001', 'simple'])
|
self.dispatch(['run', '-d', '-p', '30000:3000', '--publish', '30001:3001', 'simple'])
|
||||||
|
@ -1310,7 +1310,7 @@ class CLITestCase(DockerClientTestCase):
|
||||||
self.assertEqual(port_short, "0.0.0.0:30000")
|
self.assertEqual(port_short, "0.0.0.0:30000")
|
||||||
self.assertEqual(port_full, "0.0.0.0:30001")
|
self.assertEqual(port_full, "0.0.0.0:30001")
|
||||||
|
|
||||||
def test_run_service_with_explicitly_maped_ip_ports(self):
|
def test_run_service_with_explicitly_mapped_ip_ports(self):
|
||||||
# create one off container
|
# create one off container
|
||||||
self.base_dir = 'tests/fixtures/ports-composefile'
|
self.base_dir = 'tests/fixtures/ports-composefile'
|
||||||
self.dispatch([
|
self.dispatch([
|
||||||
|
|
|
@ -184,7 +184,7 @@ class CLITestCase(unittest.TestCase):
|
||||||
mock_client.create_host_config.call_args[1].get('restart_policy')
|
mock_client.create_host_config.call_args[1].get('restart_policy')
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_command_manula_and_service_ports_together(self):
|
def test_command_manual_and_service_ports_together(self):
|
||||||
project = Project.from_config(
|
project = Project.from_config(
|
||||||
name='composetest',
|
name='composetest',
|
||||||
client=None,
|
client=None,
|
||||||
|
|
Loading…
Reference in New Issue