示例#1
0
def test_readme_read_write():
    config_file = get_temp_file()

    _, config = get_readme_sequence()

    config.write(config_file)

    assert config.read(config_file) == config
示例#2
0
def test_repo_read_write():
    config_file = get_temp_file()
    _, config = get_repo_sequence()
    config.write(config_file)

    assert config.read(config_file) == config
    temp_dir = get_temp_path(prefix="test_repo_read_write")
    package = PythonPackage(base_dir=temp_dir,
                            collection_config=config.collection)

    config.write_to_package(package)

    assert DataRepoConfig.read_from_package(temp_dir) == config
示例#3
0
def test_read_write():
    file_loc = get_temp_file()

    config = CacheConfig(
        enable=True,
        data_storage_location=Path.cwd() / "data",
        git_storage_location=Path.cwd() / "data",
        cache_uploads=True,
    )

    config.write(file_loc)

    loaded_config = CacheConfig.read(file_loc)

    assert loaded_config == config
示例#4
0
def test_read_write():
    file_loc = get_temp_file()

    s3_config = S3Config(url="http://google.be",
                         profile="profile",
                         bucket="bucket")
    remote_config = RemoteConfig(remote_type=RemoteType.S3,
                                 data_folder="data",
                                 config=s3_config)

    remote_config.write(file_loc)

    loaded_config = RemoteConfig.read(file_loc)

    assert loaded_config == remote_config
示例#5
0
def test_package_read_write(monkeypatch):
    config_file = get_temp_file()
    _, config = get_package_sequence()
    config.write(config_file)

    assert config.read(config_file) == config
示例#6
0
def test_collection_read_write(monkeypatch):
    config_file = get_temp_file()
    _, config = get_collection_sequence()
    config.write(config_file)

    assert config.read(config_file) == config