-
Notifications
You must be signed in to change notification settings - Fork 30
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
Tdl 12262 add ticket fields stream #52
base: TDL-20356-update-function-based-to-class-based
Are you sure you want to change the base?
Changes from 6 commits
8cb74e1
0e60569
7941d05
4d9da2f
efa6da6
a371559
4c47ce5
8d802e8
097ae83
8077833
d484fc9
c670ff1
5ba0889
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": ["null", "integer"] | ||
}, | ||
"default": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"description": { | ||
"type": ["null", "string"] | ||
}, | ||
"label": { | ||
"type": ["null", "string"] | ||
}, | ||
"name": { | ||
"type": ["null", "string"] | ||
}, | ||
"position": { | ||
"type": ["null", "integer"] | ||
}, | ||
"required_for_closure": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"type": { | ||
"type": ["null", "string"] | ||
}, | ||
"required_for_agents": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"required_for_customers": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"label_for_customers": { | ||
"type": ["null", "string"] | ||
}, | ||
"customers_can_edit": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"displayed_to_customers": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"portal_cc": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"portal_cc_to": { | ||
"type": ["null", "string"] | ||
}, | ||
"choices": {}, | ||
"is_fsm": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"field_update_in_progress": { | ||
"type": ["null", "boolean"] | ||
}, | ||
"dependent_fields": { | ||
"type": ["null", "array"], | ||
"items": { | ||
"type": ["null", "object"], | ||
"properties": {} | ||
} | ||
}, | ||
"section_mappings": { | ||
"type": ["null", "array"], | ||
"items": { | ||
"type": ["null", "object"], | ||
"properties": {} | ||
} | ||
}, | ||
"created_at": { | ||
"type": ["null", "string"], | ||
"format": "date-time" | ||
}, | ||
"updated_at": { | ||
"type": ["null", "string"], | ||
"format": "date-time" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -43,7 +43,7 @@ def test_run(self): | |||||
with self.subTest(stream=stream): | ||||||
# Not able to generate more data as roles stream requires pro account. | ||||||
# So, updating page_sie according to data available. | ||||||
if stream == "roles": | ||||||
if stream == "roles" or stream == "ticket_fields": | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. |
||||||
page_size = 2 | ||||||
else: | ||||||
page_size = 100 | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,21 @@ def name(): | |
return "tap_tester_freshdesk_start_date_test" | ||
|
||
def test_run(self): | ||
# Streams to verify start date tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the doc string. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added docstring to describe the |
||
expected_streams = self.expected_streams() | ||
|
||
# To collect "time_entries", "satisfaction_ratings" pro account is needed. Skipping them for now. | ||
expected_streams = expected_streams - {'satisfaction_ratings', 'time_entries'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we merge these two separate lines into one? expected_streams = self.expected_streams() - {'satisfaction_ratings', 'time_entries'} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merged mentioned two lines to reduce redundancy. |
||
|
||
# running start_date_test for `ticket_fields` stream | ||
expected_stream_1 = {"ticket_fields"} | ||
self.run_start_date(expected_stream_1, "2019-07-19T00:00:00Z") | ||
|
||
# running start_date_test for rest of the streams | ||
expected_streams = expected_streams - expected_stream_1 | ||
self.run_start_date(expected_streams, "2022-07-19T00:00:00Z") | ||
|
||
def run_start_date(self, expected_streams, new_start_date): | ||
""" | ||
• Verify that a sync with a later start date has at least one record synced | ||
and less records than the 1st sync with a previous start date | ||
|
@@ -28,16 +43,13 @@ def test_run(self): | |
""" | ||
|
||
self.start_date_1 = self.get_properties().get('start_date') | ||
self.start_date_2 = "2022-07-19T00:00:00Z" | ||
self.start_date_2 = new_start_date | ||
|
||
self.start_date = self.start_date_1 | ||
|
||
start_date_1_epoch = self.dt_to_ts(self.start_date_1, self.START_DATE_FORMAT) | ||
start_date_2_epoch = self.dt_to_ts(self.start_date_2, self.START_DATE_FORMAT) | ||
|
||
# To collect "time_entries", "satisfaction_ratings" pro account is needed. Skipping them for now. | ||
expected_streams = self.expected_streams() - {'satisfaction_ratings', 'time_entries'} | ||
|
||
########################################################################## | ||
### First Sync | ||
########################################################################## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the type is not mentioned for
choices
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the Freshdesk API documentation,
choices
is the list of values. But, in the actual response, we observed different types of values including alist of strings
,plain object(dict),
anobject of the list
, etc. That's why due to uncertainty in the value of this field, we kept{}
as datatype and generally we keep{}
in such cases.