def test_is_running() -> None:
     fake_client = FakeClient()
     bootstrapper = Bootstrapper(fake_client, FakeLowLevelAPI())
     assert bootstrapper.is_running("core") is False
     fake_core = FakeContainer(Bootstrapper.CORE_CONTAINER_NAME)
     fake_client.set_active_dockers([fake_core])
     assert bootstrapper.is_running("core")
 def test_bootstrap_start(self) -> None:
     self.fs.create_file(Bootstrapper.DOCKER_CONFIG_FILE_PATH,
                         contents=SAMPLE_JSON)
     bootstrapper = Bootstrapper(FakeClient(), FakeLowLevelAPI())
     assert bootstrapper.is_running("core") is False
     bootstrapper.run()
     assert bootstrapper.is_running("core")
 def test_bootstrap_start_bad_json(self) -> None:
     self.fs.create_file(Bootstrapper.DEFAULT_FILE_PATH,
                         contents=SAMPLE_JSON)
     self.fs.create_file(Bootstrapper.DOCKER_CONFIG_FILE_PATH,
                         contents=json.dumps({"potato": "bread"}))
     bootstrapper = Bootstrapper(FakeClient(), FakeLowLevelAPI())
     bootstrapper.run()
     assert bootstrapper.is_running("core")
 def test_start_core_and_ttyd(self) -> None:
     self.fs.create_file(Bootstrapper.DOCKER_CONFIG_FILE_PATH,
                         contents=SAMPLE_JSON)
     fake_client = FakeClient()
     bootstrapper = Bootstrapper(fake_client, FakeLowLevelAPI())
     bootstrapper.start("core")
     bootstrapper.start("ttyd")
     assert bootstrapper.is_running("core")
     assert bootstrapper.is_running("ttyd")