refactor: drop the private aliases kept for the siblings
package._canonical_bytes, package._zip_entries, anchors._follow and traces._anchors are gone; paperdesk and paperforms use the public names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YCVvg4F3wpYQjq1NQUSmxN
This commit is contained in:
6 files changed
+5
-22
No files matched your search
@@ -836,8 +836,8 @@ def _jsonl(name):
|
||||
|
||||
|
||||
class TestFollow:
|
||||
def test_follow_is_the_old_private_name(self):
|
||||
assert anchors._follow is anchors.follow
|
||||
def test_follow_has_no_alias_under_its_old_private_name(self):
|
||||
assert not hasattr(anchors, "_follow")
|
||||
|
||||
def test_a_live_node_is_followed_to_itself(self, tree):
|
||||
assert anchors.follow(tree["state"], tree["s1"]) == (tree["s1"], [], None)
|
||||
|
||||
@@ -19,7 +19,7 @@ from paperspec.tree import Refusal
|
||||
def test_parse_canonical_reads_doubles_and_refuses_what_is_not_canonical():
|
||||
value = package.parse_canonical(b'{"a":100000000000000000000}', "x")
|
||||
assert value == {"a": 1e20} and isinstance(value["a"], float)
|
||||
assert package._canonical_bytes is package.parse_canonical
|
||||
assert not hasattr(package, "_canonical_bytes") # no alias for the old name
|
||||
with pytest.raises(Refusal) as e:
|
||||
package.parse_canonical(b'{ "a":1}', "x:1")
|
||||
assert e.value.rule == "package.file.canonical"
|
||||
@@ -68,7 +68,7 @@ def test_read_zip_files_refuses_what_is_not_a_zip(tmp_path):
|
||||
def test_check_zip_entries_returns_the_folder_without_reading():
|
||||
with zipfile.ZipFile(TINY_ZIP) as zf:
|
||||
assert package.check_zip_entries(zf) == TINY.name
|
||||
assert package._zip_entries is package.check_zip_entries
|
||||
assert not hasattr(package, "_zip_entries") # no alias for the old name
|
||||
|
||||
|
||||
def test_flatten_keeps_private_keys_and_leaves_the_spec_alone():
|
||||
|
||||
Reference in new issue
Block a user