Skip to content

Commit 3466ffd

Browse files
committed
Fix test failing due to timezone
1 parent 250fae2 commit 3466ffd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Test REST client.
22
# Author: Tony DiCola (tdicola@adafruit.com)
3+
import os
34
import time
45
import unittest
56

@@ -52,7 +53,7 @@ def ensure_dashboard_deleted(self, client, dashboard):
5253
client.delete_dashboard(dashboard)
5354
except RequestError:
5455
# Swallow the error if the dashboard doesn't exist.
55-
pass
56+
time.localtime()
5657

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

0 commit comments

Comments
 (0)