Move 'auto_start' option default to Service and add unit tests

Signed-off-by: Chris Corbyn <chris@w3style.co.uk>
This commit is contained in:
d11wtq 2014-06-07 13:03:53 +00:00 committed by Chris Corbyn
commit 0c12db06ec
4 changed files with 12 additions and 11 deletions

View file

@ -13,7 +13,7 @@ class ProjectTest(unittest.TestCase):
{
'name': 'db',
'image': 'ubuntu'
}
},
], None)
self.assertEqual(len(project.services), 2)
self.assertEqual(project.get_service('web').name, 'web')

View file

@ -20,6 +20,10 @@ class ServiceTest(unittest.TestCase):
Service('a')
Service('foo')
def test_auto_start_defaults_true(self):
service = Service(name='foo', project='bar')
self.assertEqual(service.options['auto_start'], True)
def test_project_validation(self):
self.assertRaises(ConfigError, lambda: Service(name='foo', project='_'))
Service(name='foo', project='bar')