def test_unscale_after_restart(self): web = self.create_service('web') project = Project('figtest', [web], self.client) project.start() service = project.get_service('web') service.scale(1) self.assertEqual(len(service.containers()), 1) service.scale(3) self.assertEqual(len(service.containers()), 3) project.up() service = project.get_service('web') self.assertEqual(len(service.containers()), 3) service.scale(1) self.assertEqual(len(service.containers()), 1) project.up() service = project.get_service('web') self.assertEqual(len(service.containers()), 1) # does scale=0 ,makes any sense? after recreating at least 1 container is running service.scale(0) project.up() service = project.get_service('web') self.assertEqual(len(service.containers()), 1) project.kill() project.remove_stopped()
def test_get_service(self): web = Service( project='figtest', name='web', client=None, image="busybox:latest", ) project = Project('test', [web], None) self.assertEqual(project.get_service('web'), web)
def test_get_service(self): web = self.create_service('web') project = Project('test', [web], self.client) self.assertEqual(project.get_service('web'), web)
def test_get_service(self): web = self.create_service("web") project = Project("test", [web], self.client) self.assertEqual(project.get_service("web"), web)