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

ignore zero value usages #648

Merged
merged 2 commits into from
Aug 21, 2018
Merged

ignore zero value usages #648

merged 2 commits into from
Aug 21, 2018

Conversation

szymi-
Copy link
Contributor

@szymi- szymi- commented Aug 21, 2018

No description provided.

@@ -1264,6 +1300,7 @@ def test_pricing_service_usage_api_endpoint_with_filtering_by_service(self): #
self.assertEquals(resp.status_code, 200)
received_response = json.loads(resp.content)
usages = received_response['usages']
usages.sort()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was failing randomly - sorting usages fixes it.

)
daily_usages.append(daily_usage)
usages_daily_pricing_objects[usage_type].append(
daily_pricing_object
)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this line be indented by 4 more spaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it should

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 76.763% when pulling 5096ff5 on szymi-:zero_value_usages into 694a293 on allegro:develop.

@szymi- szymi- merged commit 1e714d1 into allegro:develop Aug 21, 2018
mkurek added a commit that referenced this pull request Dec 4, 2018
…y usages

When pricing service has multiple services (for distributing cost) and
not every DailyUsage is present (see #648 - ignoring zero-value usage)
costs were not distributed properly. It was caused by storying usage
values for single service environment on lists - these lists have
different size and when accessing by index (and using `zip` to
join this list with total usage and percentage for usage type)
usage value was combined with wrong total usage and percentage.
mkurek added a commit that referenced this pull request Dec 5, 2018
…y usages (#652)

When pricing service has multiple services (for distributing cost) and
not every DailyUsage is present (see #648 - ignoring zero-value usage)
costs were not distributed properly. It was caused by storying usage
values for single service environment on lists - these lists have
different size and when accessing by index (and using `zip` to
join this list with total usage and percentage for usage type)
usage value was combined with wrong total usage and percentage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants