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

Unittests for Pipeline #71

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test isValidKeyCol
philerooski committed Feb 13, 2018
commit ccb15c0a4e85207fab1b53f8372b8cc2f8339906
19 changes: 19 additions & 0 deletions tests/unit/test_Pipeline.py
Original file line number Diff line number Diff line change
@@ -180,3 +180,22 @@ def test_addLinks(self, pipeline):
with pytest.raises(AttributeError):
pipeline.view = None
pipeline.addLinks()


class TestKey(object):
@pytest.fixture(scope='class')
def pipeline(self, genericPipeline, sampleFile, sampleMetadata):
genericPipeline.view = sampleFile
genericPipeline._meta = sampleMetadata
return genericPipeline

def test_isValidKeyPair(self, pipeline):
# no overlap
assert not pipeline.isValidKeyPair("name", "mexico")
# complete overlap (view is subset of meta)
pipeline.view["mexico_view"] = list(
pipeline._meta["mexico"][:len(pipeline.view)])
assert pipeline.isValidKeyPair("mexico_view", "mexico")
# partial overlap
pipeline.view.loc[0, 'mexico_view'] = None
assert not pipeline.isValidKeyPair("mexico_view", "mexico")