From 5ecc97983d1fa802a92f08f681b028d7de868ed6 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Sat, 20 Apr 2019 23:32:04 +0200 Subject: [PATCH] install instructions --- INSTALL.sh | 4 ++++ test_tz.py => test_tww.py | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100755 INSTALL.sh rename test_tz.py => test_tww.py (90%) diff --git a/INSTALL.sh b/INSTALL.sh new file mode 100755 index 0000000..69a66f8 --- /dev/null +++ b/INSTALL.sh @@ -0,0 +1,4 @@ +#!/bin/bash +virtualenv -p python3 venv +source venv/bin/activate +pip install -r requirements.txt diff --git a/test_tz.py b/test_tww.py similarity index 90% rename from test_tz.py rename to test_tww.py index 82ffa80..2e7f266 100644 --- a/test_tz.py +++ b/test_tww.py @@ -2,14 +2,16 @@ import datetime import unittest 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(): now = datetime.datetime.now() local_tzinfo = now.astimezone().tzinfo delta = local_tzinfo.utcoffset(now) - return delta.total_seconds()/3600 + return delta.total_seconds() / 3600 + FROZEN_TIME = "2015-03-14 09:26:53 UTC" @@ -37,9 +39,9 @@ class IntegrationTests(unittest.TestCase): local_tz = test[0] query = test[1].split(" ") result = test[2] - + freezer = freeze_time(FROZEN_TIME, tz_offset=local_tz) - + freezer.start() self.assertEqual(query_to_format_result(query), result) freezer.stop()