install instructions
This commit is contained in:
parent
a5aa0044ae
commit
5ecc97983d
4
INSTALL.sh
Executable file
4
INSTALL.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
virtualenv -p python3 venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
@ -2,14 +2,16 @@ import datetime
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
import pytz
|
|
||||||
from tz import query_to_format_result, setup_logging_level
|
from tww import query_to_format_result, setup_logging_level
|
||||||
|
|
||||||
|
|
||||||
def get_local_hours_offset():
|
def get_local_hours_offset():
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
local_tzinfo = now.astimezone().tzinfo
|
local_tzinfo = now.astimezone().tzinfo
|
||||||
delta = local_tzinfo.utcoffset(now)
|
delta = local_tzinfo.utcoffset(now)
|
||||||
return delta.total_seconds()/3600
|
return delta.total_seconds() / 3600
|
||||||
|
|
||||||
|
|
||||||
FROZEN_TIME = "2015-03-14 09:26:53 UTC"
|
FROZEN_TIME = "2015-03-14 09:26:53 UTC"
|
||||||
|
|
||||||
@ -37,9 +39,9 @@ class IntegrationTests(unittest.TestCase):
|
|||||||
local_tz = test[0]
|
local_tz = test[0]
|
||||||
query = test[1].split(" ")
|
query = test[1].split(" ")
|
||||||
result = test[2]
|
result = test[2]
|
||||||
|
|
||||||
freezer = freeze_time(FROZEN_TIME, tz_offset=local_tz)
|
freezer = freeze_time(FROZEN_TIME, tz_offset=local_tz)
|
||||||
|
|
||||||
freezer.start()
|
freezer.start()
|
||||||
self.assertEqual(query_to_format_result(query), result)
|
self.assertEqual(query_to_format_result(query), result)
|
||||||
freezer.stop()
|
freezer.stop()
|
Loading…
Reference in New Issue
Block a user