mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 06:43:06 +02:00
tests: Add sanity check for fill_uuid matching only one task
This commit is contained in:
parent
17d977cdc5
commit
d73ead1bf7
1 changed files with 5 additions and 0 deletions
|
@ -241,6 +241,11 @@ class MultipleSourceTest(IntegrationTest):
|
||||||
# Find the task and fill in its uuid
|
# Find the task and fill in its uuid
|
||||||
tasks = self.tw.tasks.filter(description=match.group('desc'))
|
tasks = self.tw.tasks.filter(description=match.group('desc'))
|
||||||
extra_tasks = self.extra_tw.tasks.filter(description=match.group('desc'))
|
extra_tasks = self.extra_tw.tasks.filter(description=match.group('desc'))
|
||||||
|
|
||||||
|
if len(tasks) > 1 or len(extra_tasks) > 1:
|
||||||
|
raise RuntimeError("Description '{0}' matches multiple tasks. "
|
||||||
|
"Aborting fill_uuid operation.".format(match.group('desc')))
|
||||||
|
|
||||||
if tasks:
|
if tasks:
|
||||||
# Return {uuid} replaced by short form UUID
|
# Return {uuid} replaced by short form UUID
|
||||||
return line.format(uuid=tasks[0]['uuid'].split('-')[0])
|
return line.format(uuid=tasks[0]['uuid'].split('-')[0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue