示例#1
4
 def test_update(self):
     p = Pydo(USER)
     tasktr = "test update #task"
     updatedTaskstr = "test #task is updated"
     p.create(taskstr)
     p.save()
     p = False
     # not sure if it even compiles but I don't want to lose the work done in lunch
     rv = self.app.put(HOME + "update", data=taskstr + "\r\n" + updatedTaskstr)
     p = Pydo(USER)
     assert 1 == len(p.tasks())
     assert updatedTaskstr == p.tasks()[0]._text
示例#2
3
 def test_non_empty_db(self):
     p = Pydo(USER)
     p.create("test")
     p.save()
     p = False
     rv = self.app.get(HOME + "tasks")
     assert '[[{"raw": "test", "type": "text"}]]' in rv.data
示例#3
3
 def test_delete(self):
     p = Pydo(USER)
     taskstr = "one #test task"
     p.create(taskstr)
     p.save()
     p = False
     rv = self.app.post(HOME +"delete", data=taskstr)
     p = Pydo(USER)
     assert 0 == len(p.tasks())
示例#4
0
 def test_query(self):
     p = Pydo(USER)
     p.create("one #project to find")
     p.create("one project to @ignore")
     p.save()
     p = False
     rv = self.app.get(HOME + "query?find=%23project")
     assert '{"data": "project", "raw": "#project", "type": "tag"}' in rv.data
     # one does not simply ignore queries
     rv = self.app.get(HOME + "query?find=%40ignore")
     assert '{"data": "ignore", "raw": "@ignore", "type": "context"}' in rv.data
示例#5
0
 def test_traits(self):
     p = Pydo(USER)
     p.create("three #tags to #find @work")
     p.create("one #context to @ignore")
     p.save()
     p = False
     rv = self.app.get(HOME + "traits?find=%23")
     assert '#tags' in rv.data
     assert '#find' in rv.data
     assert '#context' in rv.data
     rv = self.app.get(HOME + "traits?find=%40")
     assert '@work' in rv.data
     assert '@ignore' in rv.data
示例#6
0
from pydo.pydo import Pydo

p = Pydo('3bf2402f51385ea7c85a9be66815ce51fba33eb34c28d123771f9b441aa64b72')
p.reset()
p.create('#sleep is good')
p.create('sleep is #awesome')
p.save()
assert(len(p.tasks()) == 2)
print('Injected '+str(len(p.tasks()))+' tasks')
示例#7
0
def create(user):
    p = Pydo(user)
    p.create(request.data)
    p.save()