Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_task fails if 'project' value contains "project" and a number #106

Closed
fradeve opened this issue May 1, 2016 · 4 comments
Closed

add_task fails if 'project' value contains "project" and a number #106

fradeve opened this issue May 1, 2016 · 4 comments

Comments

@fradeve
Copy link

fradeve commented May 1, 2016

Very race condition.

tw.task_add(description='test1', project='life')
tw.task_add(description='test1', project='life1')
tw.task_add(description='test1', project='life_1')

works fine, while all the following give me a TaskwarriorError exception:

tw.task_add(description='test1', project='project1')
tw.task_add(description='test1', project='project_1')
tw.task_add(description='test1', project='project_2')
@fradeve fradeve changed the title add_task fails if 'project' value contains project and a number add_task fails if 'project' value contains "project" and a number May 1, 2016
@ralphbean
Copy link
Owner

FYI, I'm able to duplicate this failure with:

diff --git a/taskw/test/test_datas.py b/taskw/test/test_datas.py
index 001eb9f..f2f461b 100644
--- a/taskw/test/test_datas.py
+++ b/taskw/test/test_datas.py
@@ -365,6 +365,19 @@ class TestDBShellout(_BaseTestDB):
         eq_(len(tasks), 1)
         eq_(tasks[0]['id'], 2)

+    def test_add_with_project_string(self):
+        """ https://github.com/ralphbean/taskw/issues/106 """
+        task1 = self.tw.task_add(description='test1', project='project1')
+        task2 = self.tw.task_add(description='test2', project='project_1')
+        task3 = self.tw.task_add(description='test3', project='project_2')
+        tasks = self.tw.filter_tasks({
+            'description.contains': 'test',
+        })
+        eq_(len(tasks), 3)
+        eq_(tasks[0]['project'], 'project1')
+        eq_(tasks[1]['project'], 'project_1')
+        eq_(tasks[2]['project'], 'project_2')
+
     def test_filtering_brace(self):
         task1 = self.tw.task_add("[foobar1]")
         task2 = self.tw.task_add("[foobar2]")

@ralphbean
Copy link
Owner

This seems to be failing at the taskwarrior level (instead of taskw)...

Does this command work for you?

task add proj:project1 testing

It fails for me.

@fradeve
Copy link
Author

fradeve commented May 3, 2016

It fails for me as well, which is quite surprising. Sorry for having assumed that this was a bug in taskw. I think I should check if this has been reported in TaskWarrior. Shall I close this ticket?

@ralphbean
Copy link
Owner

Sure. Thanks @fradeve :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants