Default project_name to dirname of fig.yml

Signed-off-by: Ryan Brainard <brainard@heroku.com>
This commit is contained in:
Ryan Brainard 2014-07-12 23:35:37 -07:00
commit e9c2f2c5fb
3 changed files with 24 additions and 15 deletions

View file

@ -22,7 +22,7 @@ class CLITestCase(DockerClientTestCase):
def test_ps(self, mock_stdout):
self.command.project.get_service('simple').create_container()
self.command.dispatch(['ps'], None)
self.assertIn('fig_simple_1', mock_stdout.getvalue())
self.assertIn('simplefigfile_simple_1', mock_stdout.getvalue())
@patch('sys.stdout', new_callable=StringIO)
def test_ps_default_figfile(self, mock_stdout):
@ -31,9 +31,9 @@ class CLITestCase(DockerClientTestCase):
self.command.dispatch(['ps'], None)
output = mock_stdout.getvalue()
self.assertIn('fig_simple_1', output)
self.assertIn('fig_another_1', output)
self.assertNotIn('fig_yetanother_1', output)
self.assertIn('multiplefigfiles_simple_1', output)
self.assertIn('multiplefigfiles_another_1', output)
self.assertNotIn('multiplefigfiles_yetanother_1', output)
@patch('sys.stdout', new_callable=StringIO)
def test_ps_alternate_figfile(self, mock_stdout):
@ -42,9 +42,9 @@ class CLITestCase(DockerClientTestCase):
self.command.dispatch(['-f', 'fig2.yml', 'ps'], None)
output = mock_stdout.getvalue()
self.assertNotIn('fig_simple_1', output)
self.assertNotIn('fig_another_1', output)
self.assertIn('fig_yetanother_1', output)
self.assertNotIn('multiplefigfiles_simple_1', output)
self.assertNotIn('multiplefigfiles_another_1', output)
self.assertIn('multiplefigfiles_yetanother_1', output)
def test_up(self):
self.command.dispatch(['up', '-d'], None)