Move the modules rank_todo.py shares into bin/file_io/, inside reload's fingerprint
This commit is contained in:
@@ -20,11 +20,12 @@ from loop_claude.cycle import archive, interrupt, judge, retry, run, states, wor
|
||||
from loop_claude.project import checkout, model_choice, records
|
||||
from loop_claude.effects import Effects
|
||||
from loop_claude.claude_code import entries, session, transcript, trust
|
||||
from loop_claude.failure import Failure
|
||||
from loop_claude import file_writes, markdown_sections, paths
|
||||
from file_io.failure import Failure
|
||||
from loop_claude.cycle.verdicts import Finished, Interrupt, QuotedAnswer, Unfinished
|
||||
from loop_claude.cycle.limited import Limited
|
||||
from loop_claude.loop import main, reload
|
||||
from file_io import markdown, writes
|
||||
from loop_claude import paths
|
||||
from loop_claude.stop import Stop
|
||||
|
||||
CWD = pathlib.Path("/c")
|
||||
@@ -397,12 +398,12 @@ class Records(unittest.TestCase):
|
||||
class Sections(unittest.TestCase):
|
||||
def test_keeps_every_headed_section_with_its_bodies(self):
|
||||
text = "# Title\n\nintro\n\n## Goals\n\n1. one\n```sh\n# not a heading\n```\n### Later\n2. two\n#1 priority\n\n## Empty\n\n## Audience\nme\n## Audience\nagain\n# Appendix\nnot audience\n"
|
||||
self.assertEqual(markdown_sections.sections(text), {"Goals": ["1. one\n```sh\n# not a heading\n```\n### Later\n2. two\n#1 priority"], "Empty": [""], "Audience": ["me", "again"]})
|
||||
self.assertEqual(markdown.sections(text), {"Goals": ["1. one\n```sh\n# not a heading\n```\n### Later\n2. two\n#1 priority"], "Empty": [""], "Audience": ["me", "again"]})
|
||||
|
||||
def test_closes_a_fence_only_on_its_own_marker(self):
|
||||
text = "## Goals\n````md\n~~~\n## Quoted\n```\n````\n ~~~\n## Also quoted\n ~~~\n1. one\n## Audience\nme\n"
|
||||
self.assertEqual(list(markdown_sections.sections(text)), ["Goals", "Audience"])
|
||||
self.assertEqual(list(markdown_sections.sections("```\nquoted:\n```python\n## Inside\n```\n## Goals\n1. one\n")), ["Goals"])
|
||||
self.assertEqual(list(markdown.sections(text)), ["Goals", "Audience"])
|
||||
self.assertEqual(list(markdown.sections("```\nquoted:\n```python\n## Inside\n```\n## Goals\n1. one\n")), ["Goals"])
|
||||
|
||||
|
||||
class Render(unittest.TestCase):
|
||||
@@ -606,7 +607,7 @@ class ReplaceFile(unittest.TestCase):
|
||||
def test_removes_what_it_staged_when_the_replace_fails(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
os.mkdir(os.path.join(root, "in-the-way"))
|
||||
self.assertEqual(file_writes.replace_file(pathlib.Path(root, "in-the-way"), b"data"), Failure("Is a directory"))
|
||||
self.assertEqual(writes.replace_file(pathlib.Path(root, "in-the-way"), b"data"), Failure("Is a directory"))
|
||||
self.assertEqual(os.listdir(root), ["in-the-way"])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user