Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Add tests between indicator and serializer logic #237

Merged
merged 2 commits into from
Jan 23, 2017
Merged

Conversation

fungjj92
Copy link
Contributor

Overview

Adds a test that makes sure strings input for the agg Indicator param are correctly parsed as csvs before being serialized. This arose as an issue, since fixed, in commit 439ca70, see #158

Notes

The csv string parsing happens in a place and way that can't easily be stepped into, I saw implementing these tests this way -- which is a little heavy handed.

Testing Instructions

Tests should run clean, ./scripts/test

Closes #174

@fungjj92 fungjj92 assigned KlaasH and CloudNiner and unassigned KlaasH Jan 20, 2017
Copy link
Contributor

@CloudNiner CloudNiner left a comment

Choose a reason for hiding this comment

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

Nice. I think this is about as straightforward as it can be without doing something crazy.

split_input = agg_input.split(',')
for idx in results:
# only need to check keys from one result since all results will have identical keys
return self.assertTrue(set(split_input) == set(results[idx].keys()))
Copy link
Contributor

Choose a reason for hiding this comment

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

More than in some other places in the test suite, it might be useful to add a msg parameter here that gives a more descriptive error message than "False expected to be True". I could see it being a bit difficult to figure out whats going on and how to fix it if this test failed and I was unfamiliar with it.

From the python UnitTest docs: All the assert methods (except assertRaises(), assertRaisesRegexp()) accept a msg argument that, if specified, is used as the error message on failure

@fungjj92 fungjj92 merged commit c9b0767 into develop Jan 23, 2017
@fungjj92 fungjj92 deleted the feature/aggtests branch February 7, 2017 19:08
ddohler pushed a commit that referenced this pull request Aug 21, 2023
Add tests between indicator and serializer logic
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Indicator tests to validate 'agg' parameter
3 participants