コード例 #1
0
ファイル: test_login.py プロジェクト: Scille/parsec-cloud
async def test_login_no_available_devices(aqtbot, gui_factory,
                                          autoclose_dialog, core_config,
                                          alice):
    password = "******"
    save_device_with_password_in_config(core_config.config_dir, alice,
                                        password)

    device = list_available_devices(core_config.config_dir)[0]

    gui = await gui_factory()

    ParsecApp.add_connected_device(device.organization_id, device.device_id)

    lw = gui.test_get_login_widget()

    lw.reload_devices()

    def _devices_listed():
        assert lw.widget.layout().count() > 0

    await aqtbot.wait_until(_devices_listed)

    no_device_w = lw.widget.layout().itemAt(0).widget()
    assert isinstance(no_device_w, LoginNoDevicesWidget)
    # 0 is spacer, 1 is label
    assert no_device_w.layout().itemAt(
        2).widget().text() == "Create an organization"
    assert no_device_w.layout().itemAt(
        3).widget().text() == "Join an organization"
    assert no_device_w.layout().itemAt(4).widget().text() == "Recover a device"
コード例 #2
0
 def on_run_core_ready(self, core, core_jobs_ctx):
     self.core = core
     self.core_jobs_ctx = core_jobs_ctx
     self.core.event_bus.connect(CoreEvent.GUI_CONFIG_CHANGED, self.on_core_config_updated)
     self.event_bus.send(
         CoreEvent.GUI_CONFIG_CHANGED, gui_last_device=self.core.device.device_id.str
     )
     ParsecApp.add_connected_device(
         self.core.device.organization_addr.organization_id, self.core.device.device_id
     )
     self.logged_in.emit()
コード例 #3
0
 def on_run_core_ready(self, core, core_jobs_ctx):
     self.core = core
     self.core_jobs_ctx = core_jobs_ctx
     self.core.event_bus.connect("gui.config.changed",
                                 self.on_core_config_updated)
     self.event_bus.send(
         "gui.config.changed",
         gui_last_device="{}:{}".format(
             self.core.device.organization_addr.organization_id,
             self.core.device.device_id),
     )
     ParsecApp.add_connected_device(
         self.core.device.organization_addr.organization_id,
         self.core.device.device_id)
     self.logged_in.emit()
コード例 #4
0
ファイル: test_login.py プロジェクト: admariner/parsec-cloud
async def test_login_no_available_devices(aqtbot, gui_factory,
                                          autoclose_dialog, core_config, alice,
                                          qt_thread_gateway):
    password = "******"
    save_device_with_password(core_config.config_dir, alice, password)

    device = list_available_devices(core_config.config_dir)[0]

    gui = await gui_factory()

    ParsecApp.add_connected_device(device.organization_id, device.device_id)

    lw = gui.test_get_login_widget()

    def _reload_devices():
        lw.reload_devices()

    await qt_thread_gateway.send_action(_reload_devices)

    no_device_w = lw.widget.layout().itemAt(0).widget()
    assert isinstance(no_device_w, LoginNoDevicesWidget)