summaryrefslogtreecommitdiff
path: root/numpy/core/tests
diff options
context:
space:
mode:
authorMark Wiebe <mwiebe@enthought.com>2011-06-03 10:52:13 -0500
committerMark Wiebe <mwiebe@enthought.com>2011-06-03 10:52:13 -0500
commit681adf030eda8e9097cf53856dda6426b2351485 (patch)
tree451e28ff6c2ca6de869cd9c6bdd3800bfc8a00f3 /numpy/core/tests
parent8f35cd72500420512915f75cbefe7dd9fc12a009 (diff)
downloadnumpy-681adf030eda8e9097cf53856dda6426b2351485.tar.gz
ENH: datetime: Got repr and str for datetime scalars working
Diffstat (limited to 'numpy/core/tests')
-rw-r--r--numpy/core/tests/test_datetime.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/numpy/core/tests/test_datetime.py b/numpy/core/tests/test_datetime.py
index 1059aeaa1..d2a25c1ff 100644
--- a/numpy/core/tests/test_datetime.py
+++ b/numpy/core/tests/test_datetime.py
@@ -1,4 +1,5 @@
import os, pickle
+import numpy
import numpy as np
from numpy.testing import *
from numpy.compat import asbytes
@@ -767,15 +768,6 @@ class TestDateTime(TestCase):
self.assertRaises(ValueError, lambda : np.dtype('M8[as/10]'))
def test_string_parser_variants(self):
- """
- # Different month formats
- assert_equal(np.array(['1980-02-29'], np.dtype('M8')),
- np.array(['1980-Feb-29'], np.dtype('M8')))
- assert_equal(np.array(['1980-02-29'], np.dtype('M8')),
- np.array(['1980-feb-29'], np.dtype('M8')))
- assert_equal(np.array(['1980-02-29'], np.dtype('M8')),
- np.array(['1980-FEB-29'], np.dtype('M8')))
- """
# Allow space instead of 'T' between date and time
assert_equal(np.array(['1980-02-29T01:02:03'], np.dtype('M8')),
np.array(['1980-02-29 01:02:03'], np.dtype('M8')))
@@ -787,11 +779,14 @@ class TestDateTime(TestCase):
np.array(['-1980-02-29 01:02:03Z'], np.dtype('M8')))
# Time zone offset
assert_equal(np.array(['1980-02-29T02:02:03Z'], np.dtype('M8')),
- np.array(['1980-02-29 00:32:03+0130'], np.dtype('M8')))
+ np.array(['1980-02-29 00:32:03-0130'], np.dtype('M8')))
assert_equal(np.array(['1980-02-28T22:32:03Z'], np.dtype('M8')),
- np.array(['1980-02-29 00:02:03-01:30'], np.dtype('M8')))
+ np.array(['1980-02-29 00:02:03+01:30'], np.dtype('M8')))
assert_equal(np.array(['1980-02-29T02:32:03.506Z'], np.dtype('M8')),
- np.array(['1980-02-29 00:32:03.506+02'], np.dtype('M8')))
+ np.array(['1980-02-29 00:32:03.506-02'], np.dtype('M8')))
+ assert_equal(np.datetime64('1977-03-02T12:30-0230'),
+ np.datetime64('1977-03-02T15:00Z'))
+
def test_string_parser_error_check(self):
# Arbitrary bad string