mirror of https://github.com/docker/compose.git
Replace sets with set literal syntax for efficiency
Signed-off-by: Taufiq Rahman <taufiqrx8@gmail.com>
This commit is contained in:
parent
c37fb783fe
commit
57055e0e66
|
@ -21,7 +21,20 @@ from .utils import get_version_info
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
SILENT_COMMANDS = {'events', 'exec', 'kill', 'logs', 'pause', 'ps', 'restart', 'rm', 'start', 'stop', 'top', 'unpause'}
|
SILENT_COMMANDS = {
|
||||||
|
'events',
|
||||||
|
'exec',
|
||||||
|
'kill',
|
||||||
|
'logs',
|
||||||
|
'pause',
|
||||||
|
'ps',
|
||||||
|
'restart',
|
||||||
|
'rm',
|
||||||
|
'start',
|
||||||
|
'stop',
|
||||||
|
'top',
|
||||||
|
'unpause',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def project_from_options(project_dir, options, additional_options={}):
|
def project_from_options(project_dir, options, additional_options={}):
|
||||||
|
|
|
@ -305,20 +305,20 @@ class ProjectTest(DockerClientTestCase):
|
||||||
db_container = db.create_container()
|
db_container = db.create_container()
|
||||||
|
|
||||||
project.start(service_names=['web'])
|
project.start(service_names=['web'])
|
||||||
assert set(c.name for c in project.containers() if c.is_running) == {web_container_1.name, web_container_2.name}
|
assert set(c.name for c in project.containers() if c.is_running) == {
|
||||||
|
web_container_1.name, web_container_2.name}
|
||||||
|
|
||||||
project.start()
|
project.start()
|
||||||
assert set(c.name for c in project.containers() if c.is_running) == set(
|
assert set(c.name for c in project.containers() if c.is_running) == {
|
||||||
[web_container_1.name, web_container_2.name, db_container.name]
|
web_container_1.name, web_container_2.name, db_container.name}
|
||||||
)
|
|
||||||
|
|
||||||
project.pause(service_names=['web'])
|
project.pause(service_names=['web'])
|
||||||
assert set([c.name for c in project.containers() if c.is_paused]) == {web_container_1.name,
|
assert set([c.name for c in project.containers() if c.is_paused]) == {
|
||||||
web_container_2.name}
|
web_container_1.name, web_container_2.name}
|
||||||
|
|
||||||
project.pause()
|
project.pause()
|
||||||
assert set([c.name for c in project.containers() if c.is_paused]) == {web_container_1.name,
|
assert set([c.name for c in project.containers() if c.is_paused]) == {
|
||||||
web_container_2.name, db_container.name}
|
web_container_1.name, web_container_2.name, db_container.name}
|
||||||
|
|
||||||
project.unpause(service_names=['db'])
|
project.unpause(service_names=['db'])
|
||||||
assert len([c.name for c in project.containers() if c.is_paused]) == 2
|
assert len([c.name for c in project.containers() if c.is_paused]) == 2
|
||||||
|
|
Loading…
Reference in New Issue