-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added usage_cutoff_date to summary report for all months (#65)
* Added usage_cutoff_date to summary report for all months * Added __init__.py
- Loading branch information
Showing
6 changed files
with
64 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from seatsio import Month | ||
from tests.seatsioClientTest import SeatsioClientTest | ||
from tests.util.asserts import assert_that | ||
|
||
|
||
class UsageReportTest(SeatsioClientTest): | ||
|
||
def test_usage_report_for_all_months(self): | ||
self.assert_demo_company_secret_key_set() | ||
client = self.create_client(self.demo_company_secret_key(), None) | ||
|
||
report = client.usage_reports.summary_for_all_months() | ||
|
||
assert_that(report.usage_cutoff_date).is_not_none() | ||
assert_that(len(report.usage) > 0).is_true() | ||
assert_that(report.usage[0].month.year).is_equal_to(2014) | ||
assert_that(report.usage[0].month.month).is_equal_to(2) | ||
|
||
def test_usage_report_month(self): | ||
self.assert_demo_company_secret_key_set() | ||
client = self.create_client(self.demo_company_secret_key(), None) | ||
|
||
report = client.usage_reports.details_for_month(Month(2021, 11)) | ||
|
||
assert_that(len(report) > 0).is_true() | ||
assert_that(len(report[0].usage_by_chart) > 0).is_true() | ||
assert_that(report[0].usage_by_chart[0].usage_by_event[0].num_used_objects).is_equal_to(143) | ||
|
||
|
||
def test_usage_report_event_in_month(self): | ||
self.assert_demo_company_secret_key_set() | ||
client = self.create_client(self.demo_company_secret_key(), None) | ||
|
||
report = client.usage_reports.details_for_event_in_month(580293, Month(2021, 11)) | ||
|
||
assert_that(len(report) > 0).is_true() | ||
assert_that(report[0].num_first_selections).is_equal_to(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters