Skip to content

Commit

Permalink
Add tags to logseq test
Browse files Browse the repository at this point in the history
Three logseq-compatible tags are added to the test record: two in the
'page link' format and one in the conventional 'tag' format. The
expected results demonstrate:

- issue title: page link double brackets are replaced with special
  characters for taskwarrior compatibility
- tags:
  - the conventional tag is added first
  - non-greedy regex matching prevents the inadvertent combination of
    the two page link tags into a single tag
  - the leading `#` is stripped from all tags
  • Loading branch information
ctem committed Jan 8, 2025
1 parent 07070fd commit af53d54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_logseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestLogseqIssue(AbstractServiceTest, ServiceTest):
{"id": 1777},
{"id": 7070},
],
"content": "DOING [#A] Do something",
"content": "DOING [#A] Do something #[[Test tag]] #[[TestTag]] #TestTag",
"properties-text-values": {"duration": '{"TODO":[0,1699562197346]}'},
"marker": "DOING",
"page": {"id": 7070},
Expand Down Expand Up @@ -63,11 +63,11 @@ def test_to_taskwarrior(self):
"status": "pending",
"priority": "L",
"project": self.test_extra["graph"],
"tags": [],
"tags": ['TestTag', 'Testtag', 'TestTag'],
issue.ID: int(self.test_record["id"]),
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something",
issue.TITLE: "DOING Do something #【Test tag】 #【TestTag】 #TestTag",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
}

Expand All @@ -83,19 +83,19 @@ def test_issues(self):
expected = {
"annotations": [],
"description": f"(bw)Is#{self.test_record['id']}"
+ " - DOING Do something"
+ " - DOING Do something #【Test tag】 #【TestTag】 #TestTag"
+ " .. logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
"due": None,
"scheduled": None,
"wait": None,
"status": "pending",
"priority": "L",
"project": self.test_extra["graph"],
"tags": [],
"tags": ['TestTag', 'Testtag', 'TestTag'],
issue.ID: int(self.test_record["id"]),
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something",
issue.TITLE: "DOING Do something #【Test tag】 #【TestTag】 #TestTag",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
}

Expand Down

0 comments on commit af53d54

Please sign in to comment.