From a69e91cbb19f1f74f779b20bf66f7220edfbae44 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 21 Jun 2016 01:06:26 +0300 Subject: add asserts just in case --- bin/online_duration.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bin') diff --git a/bin/online_duration.py b/bin/online_duration.py index f074b08..5ddb34a 100644 --- a/bin/online_duration.py +++ b/bin/online_duration.py @@ -93,6 +93,10 @@ class OutputConverterJSON: _WEEKDAY_FIELD = 'weekday' _HOUR_FIELD = 'hour' + assert _DATE_FIELD not in map(str, _OUTPUT_USER_FIELDS) + assert _WEEKDAY_FIELD not in map(str, _OUTPUT_USER_FIELDS) + assert _HOUR_FIELD not in map(str, _OUTPUT_USER_FIELDS) + @staticmethod def convert_user(user): obj = OrderedDict() @@ -124,6 +128,8 @@ class OutputWriterJSON: _DURATION_FIELD = 'duration' + assert _DURATION_FIELD not in map(str, _OUTPUT_USER_FIELDS) + _CONVERT_KEY = { Grouping.USER: OutputConverterJSON.convert_user, Grouping.DATE: OutputConverterJSON.convert_date, -- cgit v1.2.3