You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units
Sam Doran 719c40bfdf
[stable-2.10] facts - fix incorrect time for some date_time_facts (#70665) (#70996)
* [stable-2.10] facts - fix incorrect time for some date_time_facts (#70665)

The iso8601_micro and iso8601 facts incorrectly called now.utcnow(), resulting
in a new timestamp at the time it was called, not a conversion of the previously
stored timestamp.

Correct this by capturing the UTC timestamp once then calculating the local
time using the UTC offset of the current system.

* Use time.time() for getting the current time
* Convert from that stored epoch timestamp to local and UTC times
* Used existing timestamp for epoch time
* Add unit tests that validate the formate of the return value rather than an exact value since mocking time and timezone is non-trivial
(cherry picked from commit c4f442ed5a)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* Remove tests for tz_dst since that only exists in newer versions
4 years ago
..
_vendor transparent downstream vendoring (#69850) 5 years ago
ansible_test Add Azure Pipelines support to ansible-test. 5 years ago
cli ansible-galaxy - fix collection installation with trailing slashes (#70016) 5 years ago
compat Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
config [stable-2.10] Clean up unit test boilerplate. 4 years ago
errors Remove empty overridden unittest.setUp and unittest.tearDown methods. 5 years ago
executor fix internal cases of actions calling unqualified module names (#70818) (#70840) 4 years ago
galaxy [2.10] Improve ansible-galaxy STDOUT messages for collections (#70379) 4 years ago
inventory [stable-2.10] Clean up unit test boilerplate. 4 years ago
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 10 years ago
mock [stable-2.10] Clean up unit test boilerplate. 4 years ago
module_utils [stable-2.10] facts - fix incorrect time for some date_time_facts (#70665) (#70996) 4 years ago
modules [stable-2.10] Clean up unit test boilerplate. 4 years ago
parsing [stable-2.10] Ensure single vaulted values aren't counted as sequences. Fixes #70784 (#70786) (#70791) 4 years ago
playbook [stable-2.10] Clean up unit test boilerplate. 4 years ago
plugins fix internal cases of actions calling unqualified module names (#70818) (#70840) 4 years ago
regex Add toggle to control invalid character substitution in group names (#52748) 6 years ago
template Do not treat AnsibleUndefined as being unsafe (#65202) 5 years ago
utils reset logging to INFO (#70878) (#70881) 4 years ago
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 5 years ago
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
requirements.txt Remove unnecessary unit test requirements. 5 years ago
test_constants.py [stable-2.10] Clean up unit test boilerplate. 4 years ago
test_context.py [stable-2.10] Clean up unit test boilerplate. 4 years ago