-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
archer v2: fixed fetch times and timzone #10247
Conversation
mocker.patch.object(client, 'search_records', return_value=([record], {})) | ||
_, next_fetch = fetch_incidents(client, params, last_fetch) | ||
assert last_fetch < next_fetch | ||
assert next_fetch == datetime(2018, 4, 3, 10, 3, tzinfo=timezone.utc) |
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.
asset occurred
incident, incident_created_time = client.record_to_incident( | ||
INCIDENT_RECORD, 75, 'Date/Time Reported', day_first=False | ||
) | ||
assert incident_created_time.strftime('%Y-%m-%dT%H:%M:%SZ') == '2018-03-26T10:03:00Z' | ||
assert incident['occurred'] == '2018-03-26T10:03:00Z' | ||
|
||
@pytest.mark.parametrize('date_time_reported, use_european_time', [ | ||
('2018-04-03T10:03:00.000Z', False), |
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.
check zulu time with europeantime is true
check true/false statement (11/29).
@@ -57,8 +57,15 @@ def parse_date_to_datetime(date: str, day_first: bool = False) -> datetime: | |||
Returns: | |||
a datetime object | |||
""" | |||
date_order = {'DATE_ORDER': 'DMY' if day_first else 'MDY'} | |||
date_obj = parser(date, settings=date_order) | |||
if 'z' in date.lower(): # For OCCURRED like time stamps |
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.
check is parser getting a timezone
) | ||
_, next_fetch = fetch_incidents(client, params, last_fetch) | ||
assert last_fetch < next_fetch | ||
assert next_fetch == datetime(2020, 3, 18, 10, 30, tzinfo=timezone.utc) |
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.
assert occurred time
assert last_fetch < next_fetch | ||
assert next_fetch == datetime(2018, 4, 3, 10, 3, tzinfo=timezone.utc) | ||
|
||
def test_two_fetches(self, mocker): |
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.
check of not european time, and with date like 29/11.
@@ -7,8 +7,8 @@ This integration was integrated and tested with version xx of RSA Archer v2 | |||
3. Click **Add instance** to create and configure a new integration instance. | |||
|
|||
## Clarifications | |||
The timezone (offset) parameter should be used if the Cortex XSOAR server and Archer's server aren't in the same time zone. | |||
If the Cortex XSOAR server time is 00:00 and the Archer server time is 01:00, the timezone parameter should be -60 (minutes). | |||
The timezone (offset) parameter should be used if the Cortex XSOAR server and Archer's server arn't in the same time zone. |
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.
The timezone (offset) parameter should be used if the Cortex XSOAR server and Archer's server arn't in the same time zone. | |
The timezone (offset) parameter should be used if the Cortex XSOAR server and Archer's server are not in the same time zone. |
Status
Related Issues
fixes: https://github.com/demisto/etc/issues/30546
Description
Fixed error when comparing DateTime object with different timezones.
Does it break backward compatibility?
Must have