Skip to content

Commit

Permalink
Test string UDAs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Apr 8, 2014
1 parent 2de883c commit 37c3c28
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion taskw/test/test_datas.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def setup(self):
dname = tempfile.mkdtemp(prefix='taskw-tests-data')

with open(fname, 'w') as f:
f.writelines(['data.location=%s' % dname])
f.writelines([
'data.location=%s\n' % dname,
'uda.somestring.label=Testing Date\n',
'uda.somestring.type=string\n',
])

# Create empty .data files
for piece in ['completed', 'pending', 'undo']:
Expand Down Expand Up @@ -185,6 +189,17 @@ def test_add_datetime(self):
# ... we'll just "roughly" test it instead of mocking.
assert(tasks['pending'][0]['entry'].startswith("20110101T"))

def test_add_with_uda(self):
self.tw.task_add(
"foobar",
somestring="this is a uda",
)
tasks = self.tw.load_tasks()
eq_(len(tasks['pending']), 1)
task = tasks['pending'][0]

eq_(task['somestring'], "this is a uda")

@raises(ValueError)
def test_completing_completed_task(self):
task = self.tw.task_add("foobar")
Expand Down

0 comments on commit 37c3c28

Please sign in to comment.