Esempio n. 1
0
def test_validate_folders_skip_folder(monkeypatch, tmpdir_factory):
    gateway = Tahoe(
        os.path.join(str(tmpdir_factory.mktemp("config_dir")), "SomeGrid")
    )
    gateway.magic_folders = {"FolderName": {}}
    monkeypatch.setattr(
        "gridsync.setup.prompt_for_folder_name", lambda x, y, z: (None, 0)
    )
    settings = {
        "nickname": "SomeGrid",
        "magic-folders": {"FolderName": {"code": "aaaaaaaa+bbbbbbbb"}},
    }
    assert validate_folders(settings, [gateway]) == {
        "nickname": "SomeGrid",
        "magic-folders": {},
    }
Esempio n. 2
0
def test_validate_folders_skip_folder(monkeypatch, tmpdir_factory):
    gateway = Tahoe(
        os.path.join(str(tmpdir_factory.mktemp('config_dir')), 'SomeGrid'))
    gateway.magic_folders = {'FolderName': {}}
    monkeypatch.setattr('gridsync.setup.prompt_for_folder_name',
                        lambda x, y, z: (None, 0))
    settings = {
        'nickname': 'SomeGrid',
        'magic-folders': {
            'FolderName': {
                'code': 'aaaaaaaa+bbbbbbbb'
            }
        }
    }
    assert validate_folders(settings, [gateway]) == {
        'nickname': 'SomeGrid',
        'magic-folders': {}
    }
Esempio n. 3
0
def test_validate_folders_no_known_gateways():
    assert validate_folders({}, []) == {}