-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Events Helpers to PDI Connector (#865)
* add helpers to Events object * stage docstring * add docs * linting * fix typo + enforce validation * add return docs * add events tests * use mock pdi * jk * mark live tests * add alias * drop unused imports
- Loading branch information
1 parent
07174ad
commit 1ab1c10
Showing
2 changed files
with
142 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
from test.utils import mark_live_test | ||
from parsons import Table | ||
|
||
|
||
##### | ||
|
||
START_DATE = "2020-01-01" | ||
END_DATE = "2022-12-31" | ||
EXPAND = True | ||
LOWER_LIMIT = 1 | ||
|
||
# TODO: Invoke this, it should fail as 2000 is the max limit for | ||
# all of the relevant events functions | ||
UPPER_LIMIT = 2001 | ||
|
||
|
||
@mark_live_test | ||
def test_get_calendars(live_pdi): | ||
response = live_pdi.get_calendars() | ||
|
||
assert type(response) == Table | ||
|
||
|
||
@mark_live_test | ||
def test_get_calendars_with_limit(live_pdi): | ||
response = live_pdi.get_calendars(limit=LOWER_LIMIT) | ||
|
||
assert response.num_rows == 1 | ||
|
||
|
||
@mark_live_test | ||
def test_get_event_activities(live_pdi): | ||
response = live_pdi.get_event_activities(start_date=START_DATE, end_date=END_DATE) | ||
|
||
assert type(response) == Table | ||
|
||
|
||
@mark_live_test | ||
def test_get_event_activities_with_limit(live_pdi): | ||
response = live_pdi.get_event_activities( | ||
start_date=START_DATE, end_date=END_DATE, limit=LOWER_LIMIT | ||
) | ||
|
||
assert response.num_rows == 1 | ||
|
||
|
||
@mark_live_test | ||
def test_get_event_activity_assignments(live_pdi): | ||
response = live_pdi.get_event_activity_assignments( | ||
start_date=START_DATE, end_date=END_DATE, expand=EXPAND | ||
) | ||
|
||
assert type(response) == Table | ||
|
||
|
||
@mark_live_test | ||
def test_get_event_activity_assignments_with_limit(live_pdi): | ||
response = live_pdi.get_event_activity_assignments( | ||
start_date=START_DATE, end_date=END_DATE, expand=EXPAND | ||
) | ||
|
||
assert response.num_rows == 1 |