Beispiel #1
0
 def testEditDuration(self):
     self.act.stop = datetime.now()
     self.act.put()
     newstop = self.act.start + timedelta(hours=1)
     self.app.post("/activity/duration", {"key": self.key, 'value':"1 hours"})
     eq_(newstop, Activity.get(self.key).stop)
Beispiel #2
0
 def testAddTags(self):
     response = self.app.post("/activity/tags", {'key': self.key, 'value':'new tag values'})
     eq_(['new', 'tag', 'values'], Activity.get(self.key).tags)
Beispiel #3
0
 def testEditStart(self):
     newstart = datetime(2008, 9, 17, 12, 15)
     self.app.post("/activity/start",
             {'key': self.key, 'value':newstart.strftime("%Y/%m/%d %H:%M")})
     eq_(newstart, Activity.get(self.key).start)
Beispiel #4
0
 def testRemoveTags(self):
     response = self.app.post("/activity/tags", {'key': self.key, 'value':''})
     eq_([], Activity.get(self.key).tags)
Beispiel #5
0
 def testRename(self):
     response = self.app.post("/activity/rename", {'key': self.key, 'value':'new name'})
     assert Activity.get(self.key).name == "new name"
Beispiel #6
0
 def testRestart(self):
     self.act.stop = datetime.now()
     self.act.put()
     response = self.app.post("/activity/restart", {'key': self.key})
     response.mustcontain("true", self.act.name)
     assert Activity.get(self.key).stop is None
Beispiel #7
0
 def testStop(self):
     assert self.act.stop is None
     response = self.app.post('/activity/stop', {'key': self.key})
     response.mustcontain("true", self.act.name)
     assert Activity.get(self.key) is not None
Beispiel #8
0
 def testDelete(self):
     response = self.app.post('/activity/delete', {'key': self.key})
     response.mustcontain("true")
     assert Activity.get(self.key) is None
     response = self.app.post('/activity/delete')
     response.mustcontain("false", "key must be given")