aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/tests
diff options
context:
space:
mode:
Diffstat (limited to 'pygithub3/tests')
-rw-r--r--pygithub3/tests/services/test_core.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/pygithub3/tests/services/test_core.py b/pygithub3/tests/services/test_core.py
index 8a2bbbe..556f3d9 100644
--- a/pygithub3/tests/services/test_core.py
+++ b/pygithub3/tests/services/test_core.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
-import requests
+from datetime import datetime
+import requests
from mock import patch
from pygithub3.tests.utils.core import TestCase
@@ -54,6 +55,16 @@ class TestServiceCalls(TestCase):
self.assertFalse(request_method.called)
self.assertIsInstance(result, base.Result)
+ def test_normalize_ok(self, request_method):
+ data = {'test': datetime(2012, 12, 12, 3, 3, 3)}
+ self.s._normalize_date('test', data)
+ self.assertEqual(data['test'], '2012-12-12T03:03:03Z')
+
+ def test_normalize_fail(self, request_method):
+ data = {'test': 'fail'}
+ self.s._normalize_date('test', data)
+ self.assertEqual(data['test'], 'fail')
+
@patch.object(requests.sessions.Session, 'request')
class TestMimeType(TestCase):