def test_monitor_do_checks_switch_magic_folder_checker_remote(monkeypatch): monkeypatch.setattr("gridsync.monitor.MagicFolderChecker.do_check", lambda _: MagicMock()) monitor = Monitor(MagicMock(magic_folders={"TestFolder": {}})) monitor.grid_checker = MagicMock() test_mfc = MagicFolderChecker(MagicMock(), "TestFolder") test_mfc.remote = True monitor.magic_folder_checkers = {"TestFolder": test_mfc} yield monitor.do_checks() assert monitor.magic_folder_checkers["TestFolder"].remote is False
def mfc(): mock_gateway = Mock() mock_gateway.monitor.grid_checker.is_connected = True checker = MagicFolderChecker(mock_gateway, "TestFolder") return checker
def mfc(): return MagicFolderChecker(None, 'TestFolder')