Exemplo n.º 1
0
    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()
Exemplo n.º 2
0
    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()
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def test_get_service(self):
     web = self.create_service('web')
     project = Project('test', [web], self.client)
     self.assertEqual(project.get_service('web'), web)
Exemplo n.º 6
0
 def test_get_service(self):
     web = self.create_service('web')
     project = Project('test', [web], self.client)
     self.assertEqual(project.get_service('web'), web)
Exemplo n.º 7
0
 def test_get_service(self):
     web = self.create_service("web")
     project = Project("test", [web], self.client)
     self.assertEqual(project.get_service("web"), web)