mirror of https://github.com/docker/compose.git
parent
00a1835fae
commit
892677a9d3
|
@ -15,6 +15,8 @@ from .utils import cached_property, docker_url
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class Command(DocoptCommand):
|
class Command(DocoptCommand):
|
||||||
|
base_dir = '.'
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def client(self):
|
def client(self):
|
||||||
return Client(docker_url())
|
return Client(docker_url())
|
||||||
|
@ -22,10 +24,11 @@ class Command(DocoptCommand):
|
||||||
@cached_property
|
@cached_property
|
||||||
def project(self):
|
def project(self):
|
||||||
try:
|
try:
|
||||||
config = yaml.load(open('fig.yml'))
|
yaml_path = os.path.join(self.base_dir, 'fig.yml')
|
||||||
|
config = yaml.load(open(yaml_path))
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
if e.errno == errno.ENOENT:
|
if e.errno == errno.ENOENT:
|
||||||
log.error("Can't find %s. Are you in the right directory?", e.filename)
|
log.error("Can't find %s. Are you in the right directory?", os.path.basename(e.filename))
|
||||||
else:
|
else:
|
||||||
log.error(e)
|
log.error(e)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from __future__ import absolute_import
|
||||||
|
from . import unittest
|
||||||
|
from fig.cli.main import TopLevelCommand
|
||||||
|
|
||||||
|
class CLITestCase(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.command = TopLevelCommand()
|
||||||
|
self.command.base_dir = 'tests/fixtures/simple-figfile'
|
||||||
|
|
||||||
|
def test_help(self):
|
||||||
|
self.assertRaises(SystemExit, lambda: self.command.dispatch(['-h'], None))
|
|
@ -0,0 +1,2 @@
|
||||||
|
simple:
|
||||||
|
image: ubuntu
|
Loading…
Reference in New Issue