Skip to content

Commit

Permalink
Fix broken tests after relocating parse_tag_list
Browse files Browse the repository at this point in the history
This annotates the method as `staticmethod`, so it can be used and
tested again without requiring an instance of `ModifyTagsDialog`.
  • Loading branch information
picsel2 committed Mar 11, 2024
1 parent d217803 commit fbf6120
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion GTG/gtk/browser/modify_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def __init__(self, tag_completion, app):
self.last_apply_to_subtasks = False


def parse_tag_list(self, text):
@staticmethod
def parse_tag_list(text):
""" Parse a line of a list of tasks. User can specify if the tag is
positive or not by prepending '!'.
Expand Down
7 changes: 4 additions & 3 deletions tests/tools/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from unittest import TestCase

from GTG.core.tags import extract_tags_from_text

from GTG.gtk.browser.modify_tags import ModifyTagsDialog

class TestExtractTags(TestCase):
""" extract_tags_from_text """
Expand Down Expand Up @@ -75,8 +75,9 @@ def test_accepts_ampersand_in_tag(self):
self.assertTags("@home&work", ["@home&work"])


@unittest.skip('TODO these need to move now that parse_tag_list is inside'
' ModifyTagsDialog')
# parse_tag_list was previously a free function
parse_tag_list = ModifyTagsDialog.parse_tag_list

class TestParseTagList(TestCase):
""" parse_tag_list """

Expand Down

0 comments on commit fbf6120

Please sign in to comment.