Answer principles round 1: 2 🔴, 9 🟡 (0 misread); explicit record versions in place of the Confluence store's hidden state, the routing ruling filed as item 393 for 0.12.0, rule-hook catching heavy runs through uv, poetry, sudo and doas, one unreleased heading, one owner of the no-item message, typed Jira issues, a turn that gives its failure as a value, outcome tests for the Atlassian client, an Emptied reason type, an injected clock and git in touch-predictions, and paired record names
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""What every record backend must hold, as tests. A backend's test case inherits RecordStoreContract and unittest.TestCase, and builds its store in new_store."""
|
||||
import typing
|
||||
|
||||
from record_store.held import Held
|
||||
from record_store.stores import RecordStore
|
||||
|
||||
|
||||
@@ -8,6 +9,7 @@ class RecordStoreContract:
|
||||
"""Runs against the store new_store returns: one that holds no record yet."""
|
||||
assertEqual: typing.Callable[..., None]
|
||||
assertIsNone: typing.Callable[..., None]
|
||||
assertIsInstance: typing.Callable[..., None]
|
||||
assertTrue: typing.Callable[..., None]
|
||||
|
||||
def new_store(self) -> RecordStore:
|
||||
@@ -19,14 +21,23 @@ class RecordStoreContract:
|
||||
def test_reads_back_what_it_wrote_to_the_character(self) -> None:
|
||||
store = self.new_store()
|
||||
text = "# Decisions\n\n- Å, 🔴 and a | pipe\n\n\n"
|
||||
self.assertIsNone(store.write(text))
|
||||
self.assertEqual(store.write(text), store.held())
|
||||
self.assertEqual(store.read(), text)
|
||||
|
||||
def test_a_write_replaces_the_whole_record(self) -> None:
|
||||
store = self.new_store()
|
||||
store.write("first\nsecond\n")
|
||||
self.assertIsNone(store.write("third\n"))
|
||||
first = store.write("first\nsecond\n")
|
||||
assert isinstance(first, Held), first
|
||||
# A write over the version the last one left replaces the record, as a later save does.
|
||||
self.assertIsInstance(store.write("third\n", first.version), Held)
|
||||
self.assertEqual(store.read(), "third\n")
|
||||
|
||||
def test_holds_its_text_with_the_version_a_write_over_it_names(self) -> None:
|
||||
store = self.new_store()
|
||||
store.write("text\n")
|
||||
held = store.held()
|
||||
assert isinstance(held, Held), held
|
||||
self.assertEqual(held.text, "text\n")
|
||||
|
||||
def test_names_itself_for_a_message(self) -> None:
|
||||
self.assertTrue(self.new_store().label.strip())
|
||||
|
||||
Reference in New Issue
Block a user