示例#1
0
    def test_listr(self, servers, reset, genome):
        unbound_rgc = RefGenConf()
        unbound_rgc.subscribe(servers, no_write=True, reset=reset)
        remote_list = unbound_rgc.listr(genome=genome)

        assert len(remote_list) == len(unbound_rgc[CFG_SERVERS_KEY])
        if genome is not None:
            assert all([
                len(assets_dict.keys()) == 1 and genome in assets_dict.keys()
                for url, assets_dict in remote_list.items()
            ])
        else:
            assert isinstance(remote_list, dict)
示例#2
0
def test_list_remote(rgc, tmpdir):
    """ Verify expected behavior of remote genome/asset listing. """
    new_rgc = RefGenConf(
        entries={
            CFG_FOLDER_KEY: tmpdir.strpath,
            CFG_SERVERS_KEY: [DEFAULT_SERVER],
            CFG_GENOMES_KEY: rgc[CFG_GENOMES_KEY]
        })
    result = new_rgc.listr()
    assert list(result.keys())[0].startswith(DEFAULT_SERVER)
    for server_url, asset_dict in result.items():
        assert isinstance(asset_dict, OrderedDict)
        assert len(asset_dict) == len(
            _download_json(DEFAULT_SERVER + "/genomes"))