Esempio n. 1
0
 def test_bootstrap_start(self) -> None:
     self.fs.create_file(Bootstrapper.DOCKER_CONFIG_FILE_PATH,
                         contents=SAMPLE_JSON)
     bootstrapper = Bootstrapper(FakeClient(), FakeLowLevelAPI())
     assert bootstrapper.core_is_running() is False
     bootstrapper.run()
     assert bootstrapper.core_is_running()
Esempio n. 2
0
 def test_is_running() -> None:
     fake_client = FakeClient()
     bootstrapper = Bootstrapper(fake_client, FakeLowLevelAPI())
     assert bootstrapper.core_is_running() is False
     fake_core = FakeContainer(Bootstrapper.CORE_CONTAINER_NAME)
     fake_client.set_active_dockers([fake_core])
     assert bootstrapper.core_is_running()
Esempio n. 3
0
 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.core_is_running()