Skip to content

Commit

Permalink
Fix test failing due to timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
tekktrik committed Jun 1, 2023
1 parent 250fae2 commit 3466ffd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Test REST client.
# Author: Tony DiCola (tdicola@adafruit.com)
import os
import time
import unittest

Expand Down Expand Up @@ -52,7 +53,7 @@ def ensure_dashboard_deleted(self, client, dashboard):
client.delete_dashboard(dashboard)
except RequestError:
# Swallow the error if the dashboard doesn't exist.
pass
time.localtime()

def ensure_block_deleted(self, client, dashboard, block):
# Delete the specified block if it exists.
Expand Down Expand Up @@ -182,6 +183,7 @@ def test_time_data(self):
for time_data in server_time:
self.assertIsNotNone(time_data)
# Check that the week day was interpreted properly
os.environ['TZ'] = "US/Eastern"
adjusted_time = time.localtime(time.mktime(server_time))
self.assertEqual(server_time.tm_wday, adjusted_time.tm_wday)

Expand Down

0 comments on commit 3466ffd

Please sign in to comment.