Example #1
0
    def test__connect_to_application__close_application__application_has_closed(
            self) -> None:
        kill_all_open_flexloggers()
        app = Application.launch()
        # Opening a project will make closing the application take longer
        app.open_project(get_project_path("DefaultProject"))

        app2 = Application(app.server_port)
        app2.close()

        assert_no_flexloggers_running()
Example #2
0
    def test__launch_flexlogger_separately__connect_to_existing_and_close__application_has_closed(
        self, ) -> None:
        kill_all_open_flexloggers()
        # Launch the way that Application.launch() does, but don't connect
        real_server_port = Application._launch_flexlogger(60)
        # The port file doesn't get written out until slightly after the mapped file
        # that _launch_flexlogger() is waiting for.
        # So wait for the file to exist before proceeding with the test.
        server_port_file_path = Application._get_server_port_file_path()
        while not server_port_file_path.exists():
            sleep(1)

        app = Application()
        assert real_server_port == app.server_port
        app.close()

        assert_no_flexloggers_running()