Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ingest: Add tests #54

Closed
wants to merge 6 commits into from
Closed

ingest: Add tests #54

wants to merge 6 commits into from

Conversation

victorlin
Copy link
Member

Description of proposed changes

I wrote these tests so I can understand how things work, but they also might be good to have in the repo. Filenames and tests location up for debate.

If this is desired, we don't have to add tests for all Python scripts in this PR, but it would be good to rename the scripts with underscores and .py extension here.

Related issue(s)

N/A

Testing

See CI.

Comment on lines +127 to +144
def test_wildcards_work_if_partial_match_exists(self, tmpdir):
"""Test wildcards still work even when partial matches exist."""
lines = (
"a/b/c/d\t1/2/3/4",
"a/*/*/z\t1/*/*/26",
)
geolocation_rules = get_geolocation_rules(tmpdir, lines)
assert get_annotated_geolocation(geolocation_rules, ("a", "b", "c", "z")) == ("1", "*", "*", "26")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails on master, but passes if rebased onto #55

@victorlin victorlin force-pushed the victorlin/add-transform-tests branch from ee0d29f to bf1ad54 Compare June 17, 2022 19:37
victorlin and others added 6 commits June 21, 2022 15:49
- Add bin/__init__.py so files in bin/ can be imported in a Python script.
- Rename apply-geolocation-rules to apply_geolocation_rules.py since filenames with dashes or lack of .py extension can't be imported without messing with importlib.
- TODO: Rename other scripts
@victorlin
Copy link
Member Author

This only adds tests for apply_geolocation_rules, which has moved to nextstrain/ingest. Closing in favor of adding the tests in that repo: nextstrain/ingest#26

@victorlin victorlin closed this Oct 3, 2023
@victorlin victorlin deleted the victorlin/add-transform-tests branch October 3, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants