I think a nice default is to use the timestamp of object creation time.
That was the idea behind the test at least, and indeed it also worked
like that at some point (where the test worked). Otoh - the engine will
use the current time as timestamp if the incoming event doesn't have
one, so it might be nicer to leave it out...

That said - Having the engine assign timestamps does give a slight lag
on the stamps though, so that's why I prefer having the client
generated.

And just so that we are sure we agree; timestamps are millis since
epoch, ie. int(time.time()*1000). In the Event case it needs to be a
string, so wrap a str() around that.

-- 
testInsertGetWithoutTimestamp testcase fails
https://bugs.launchpad.net/bugs/486996
You received this bug notification because you are a member of
Zeitgeist-Engine, which is the registrant for Zeitgeist Engine.

Status in Zeitgeist Engine: New

Bug description:
Running
   python test/resonance-engine-test.py
I get one failed testcase

======================================================================
FAIL: testInsertGetWithoutTimestamp (__main__.ZeitgeistEngineTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/resonance-engine-test.py", line 87, in 
testInsertGetWithoutTimestamp
    self.assertTrue(ev.timestamp)
AssertionError

----------------------------------------------------------------------

I would have fixed this if I were totally sure what the correct fix is. Right 
now the default timestamp of an event is an empty string, which is why this 
testcase fails. Is this the expected behaviour, and should we fix the test. Or 
should the default timestamp be a string containing the timestamp of object 
creation time?

_______________________________________________
Mailing list: https://launchpad.net/~zeitgeist
Post to     : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp

Reply via email to