Skip to content

Commit

Permalink
Refactor logseq test to use dynamic URI
Browse files Browse the repository at this point in the history
For improved maintainability, the logseq block URI in the expected
results is now dynamically assigned by concatenating the base URI with
the test record UUID.
  • Loading branch information
ctem committed Jan 8, 2025
1 parent af53d54 commit c991889
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_logseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class TestLogseqIssue(AbstractServiceTest, ServiceTest):
}

test_extra = {
"baseURI": "logseq://graph/Test?block-id=",
"graph": "Test",
}

Expand Down Expand Up @@ -68,7 +69,7 @@ def test_to_taskwarrior(self):
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something #【Test tag】 #【TestTag】 #TestTag",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
issue.URI: self.test_extra["baseURI"] + self.test_record["uuid"],
}

actual = issue.to_taskwarrior()
Expand All @@ -84,7 +85,7 @@ def test_issues(self):
"annotations": [],
"description": f"(bw)Is#{self.test_record['id']}"
+ " - DOING Do something #【Test tag】 #【TestTag】 #TestTag"
+ " .. logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
+ " .. " + self.test_extra["baseURI"] + self.test_record["uuid"],
"due": None,
"scheduled": None,
"wait": None,
Expand All @@ -96,7 +97,7 @@ def test_issues(self):
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something #【Test tag】 #【TestTag】 #TestTag",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
issue.URI: self.test_extra["baseURI"] + self.test_record["uuid"],
}

self.assertEqual(TaskConstructor(issue).get_taskwarrior_record(), expected)

0 comments on commit c991889

Please sign in to comment.