Skip to content

Commit

Permalink
Merge pull request #127 from refgenie/dev
Browse files Browse the repository at this point in the history
v0.11.1
  • Loading branch information
stolarczyk authored Jun 1, 2021
2 parents 7372884 + 97aec53 commit c1d6b03
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.11.1] - 2021-06-01
### Fixed
- issue with missing `assets` section in `RefGenConf.list` method. This situation occured after setting genome identity for nonexistent genome

## [0.11.0] - 2021-04-27
### Added
- `RefGenConf.populate` function to support `refgenie populate`
Expand Down
2 changes: 1 addition & 1 deletion refgenconf/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.11.0"
__version__ = "0.11.1"
2 changes: 2 additions & 0 deletions refgenconf/refgenconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def list(self, genome=None, order=None, include_tags=False):
),
)
for g in refgens
if CFG_ASSETS_KEY in self[CFG_GENOMES_KEY][g]
]
)
self.run_plugins(POST_LIST_HOOK)
Expand All @@ -338,6 +339,7 @@ def list(self, genome=None, order=None, include_tags=False):
),
)
for g in refgens
if CFG_ASSETS_KEY in self[CFG_GENOMES_KEY][g]
]
)

Expand Down
20 changes: 20 additions & 0 deletions tests/test_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ def test_multiple_genomes(self, ro_rgc, all_genomes):
ro_rgc.list().keys()
)

def test_no_asset_section(self, ro_rgc):
"""
Verify listing works even if the 'assets' section is missing in the config.
This situation may occur after setting genome identity for nonexistent genome.
"""
# get the original genomes count
ori_genomes_count = len(ro_rgc.genomes)
# set test alias, which will create an empty genome section
ro_rgc.set_genome_alias(
genome="test_alias",
digest="test_digest",
create_genome=True,
)
# check if list works and skips the empty genome
assert len(ro_rgc.list().keys()) == ori_genomes_count
# clean up
ro_rgc.remove_genome_aliases(digest="test_digest")
with ro_rgc as r:
del r["genomes"]["test_digest"]


class ListByGenomeTest:
def test_returns_entire_mapping_when_no_genonome_specified(self, my_rgc):
Expand Down

0 comments on commit c1d6b03

Please sign in to comment.