diff options
author | Benjamin Saller <bcsaller@objectrealms.net> | 2007-07-16 00:20:09 (GMT) |
---|---|---|
committer | Benjamin Saller <bcsaller@objectrealms.net> | 2007-07-16 00:20:09 (GMT) |
commit | fd0d4d345cab7fb3a011ae1c80624cca1f07545a (patch) | |
tree | dd8fc1467e82b2fa33b7cba54a91b53e2ad052f7 /tests | |
parent | 73245ec13b84d3ff7f6750f325e012087009e6ae (diff) |
changes for :date support
see test_model for an example:
uid = ds.create({'title' : "Document 1", 'thumbnail:binary' :
data, 'ctime:date' : datetime.datetime.now().isoformat()}, filename)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runalltests.py | 2 | ||||
-rw-r--r-- | tests/test_model.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/runalltests.py b/tests/runalltests.py index e3757f2..896972f 100644 --- a/tests/runalltests.py +++ b/tests/runalltests.py @@ -15,7 +15,7 @@ import doctest from pkg_resources import resource_filename import logging -logging.basicConfig(level=logging.DEBUG, +logging.basicConfig(level=logging.WARN, format="%(asctime)-15s %(name)s %(levelname)s: %(message)s", stream=sys.stderr) diff --git a/tests/test_model.py b/tests/test_model.py index 2ac2fb2..87ed94f 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -18,7 +18,7 @@ class Test(unittest.TestCase): # we have to kill the microseconds as # time.strptime which we must use in 2.4 doesn't parse it n = n.replace(microsecond=0) - p = model.Property('ctime', n, 'date') + p = model.Property('ctime', n.isoformat(), 'date') assert p.key == "ctime" # XXX: the 'date()' is a work around for a missing secore # feature right now @@ -34,19 +34,23 @@ class Test(unittest.TestCase): ds.mount(DEFAULT_STORE, {'indexmanager.model' : dm}) - + n = datetime.datetime.now() data = open('test.jpg', 'r').read() # binary data with \0's in it can cause dbus errors here fn = tmpData("with image\0\0 prop") # XXX: We should be able to remove:binary now - uid = ds.create({'title' : "Document 1", 'thumbnail:binary' : data}, fn) + uid = ds.create({'title' : "Document 1", 'thumbnail:binary' : + data, 'ctime:date' : n.isoformat()}, fn) waitforindex(ds) c = ds.get(uid) assert c.get_property('thumbnail') == data - + # I don't care about the microsecond issue now, the typelib + # patch later can fix that + assert c.get_property('ctime')[:19] == n.isoformat()[:19] + ds.stop() |