From d7b4abd93d2b7485ca65b692fa17459e853f0a79 Mon Sep 17 00:00:00 2001 From: Mark Bonsack Date: Wed, 12 Feb 2020 16:34:17 -0800 Subject: [PATCH] Comment ISO 8601 timestamp generator * Comment ISO 8601 timestamp generator * Comment new function to add space between time and TZ offset --- tests/test_cisco_acs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_cisco_acs.py b/tests/test_cisco_acs.py index 8902b44..283c696 100644 --- a/tests/test_cisco_acs.py +++ b/tests/test_cisco_acs.py @@ -16,8 +16,10 @@ def test_cisco_acs_single(record_property, setup_wordlist, setup_splunk, setup_sc4s): host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist)) +# Generate an ISO 8601 compliant timestamp with local timezone offset (2020-02-12 12:46:39.323-08:00) dt = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).astimezone().isoformat(sep=' ', timespec='milliseconds') +# Function to insert a space between the time and TZ offset (2020-02-12 12:46:39.323 -08:00) def insert_space(string, integer): return string[0:integer] + ' ' + string[integer:] @@ -40,8 +42,10 @@ def insert_space(string, integer): def test_cisco_acs_multi(record_property, setup_wordlist, setup_splunk, setup_sc4s): host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist)) +# Generate an ISO 8601 compliant timestamp with local timezone offset (2020-02-12 12:46:39.323-08:00) dt = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).astimezone().isoformat(sep=' ', timespec='milliseconds') +# Function to insert a space between the time and TZ offset (2020-02-12 12:46:39.323 -08:00) def insert_space(string, integer): return string[0:integer] + ' ' + string[integer:]