Skip to content

Commit d8e5b88

Browse files
committed
refactor: remove __int__ and __ext__ tests and mentions
1 parent 25469fe commit d8e5b88

4 files changed

Lines changed: 30 additions & 785 deletions

File tree

meshtastic/node.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,8 @@ def uploadFile(self, local_path: str, device_path: str,
11331133
11341134
Args:
11351135
local_path: Path to the local file to upload.
1136-
device_path: Destination path on the device. Use ``/__ext__/`` or
1137-
``/__int__/`` prefixes to target external or internal
1138-
flash respectively; bare ``/`` paths go to InternalFS.
1136+
device_path: Absolute path on the device filesystem (what the firmware
1137+
resolves for XModem open/write).
11391138
on_progress: Optional callback ``fn(bytes_sent, total_bytes)``.
11401139
timeout_s: Per-packet ACK timeout in seconds.
11411140
@@ -1144,7 +1143,7 @@ def uploadFile(self, local_path: str, device_path: str,
11441143
11451144
Example::
11461145
1147-
iface.localNode.uploadFile("wordle.bin", "/__ext__/bbs/kb/wordle.bin")
1146+
iface.localNode.uploadFile("wordle.bin", "/bbs/kb/wordle.bin")
11481147
"""
11491148
if self.noProto:
11501149
logger.warning("uploadFile: protocol disabled (noProto)")
@@ -1242,8 +1241,7 @@ def downloadFile(self, device_path: str, local_path: str,
12421241
"""Download a file from the device via XModem.
12431242
12441243
Args:
1245-
device_path: Source path on the device (``/__ext__/``, ``/__int__/``,
1246-
or bare ``/`` for InternalFS).
1244+
device_path: Absolute path on the device (same path rules as ``uploadFile``).
12471245
local_path: Destination path on the local filesystem.
12481246
on_progress: Optional callback ``fn(bytes_received, total_bytes)``.
12491247
``total_bytes`` is -1 (unknown) during transfer.
@@ -1254,7 +1252,7 @@ def downloadFile(self, device_path: str, local_path: str,
12541252
12551253
Example::
12561254
1257-
iface.localNode.downloadFile("/__ext__/bbs/kb/wordle.bin", "wordle.bin")
1255+
iface.localNode.downloadFile("/bbs/kb/wordle.bin", "wordle.bin")
12581256
"""
12591257
if self.noProto:
12601258
logger.warning("downloadFile: protocol disabled (noProto)")
@@ -1325,7 +1323,7 @@ def listDir(self, device_path: str, depth: int = 0, timeout_s: float = _XMODEM_T
13251323
"""List files on the device under ``device_path`` via XMODEM ``MFLIST`` (matching firmware).
13261324
13271325
Args:
1328-
device_path: Directory on the device (``/__ext__/``, ``/__int__/``, or bare ``/``).
1326+
device_path: Directory path on the device to list.
13291327
depth: Recursion depth (0 = files in that directory only; each increment adds one tree level).
13301328
timeout_s: Per-packet timeout.
13311329

meshtastic/tests/test_file_transfer_cli.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020

2121
def test_device_posix_join():
22-
assert device_posix_join("/__ext__/d", "a/b") == "/__ext__/d/a/b"
23-
assert device_posix_join("/__ext__/d/", "a", "b") == "/__ext__/d/a/b"
22+
assert device_posix_join("/mnt/d", "a/b") == "/mnt/d/a/b"
23+
assert device_posix_join("/mnt/d/", "a", "b") == "/mnt/d/a/b"
2424
assert device_posix_join("/", "x") == "/x"
2525

2626

@@ -35,8 +35,8 @@ def test_plan_upload_single_plain_file():
3535
f = os.path.join(d, "one.bin")
3636
with open(f, "wb") as fp:
3737
fp.write(b"x")
38-
pairs = plan_upload([f], "/__ext__/out.bin")
39-
assert pairs == [(f, "/__ext__/out.bin")]
38+
pairs = plan_upload([f], "/mnt/out.bin")
39+
assert pairs == [(f, "/mnt/out.bin")]
4040

4141

4242
def test_plan_upload_glob_recursive():
@@ -48,10 +48,10 @@ def test_plan_upload_glob_recursive():
4848
with open(fp, "w") as fh:
4949
fh.write("x")
5050
pat = os.path.join(d, "p", "**", "*.txt")
51-
pairs = plan_upload([pat], "/__ext__/out")
51+
pairs = plan_upload([pat], "/mnt/out")
5252
assert len(pairs) == 2
5353
devs = sorted(dev for _loc, dev in pairs)
54-
assert devs == ["/__ext__/out/a.txt", "/__ext__/out/q/b.txt"]
54+
assert devs == ["/mnt/out/a.txt", "/mnt/out/q/b.txt"]
5555

5656

5757
def test_plan_upload_directory_preserves_layout():
@@ -61,19 +61,19 @@ def test_plan_upload_directory_preserves_layout():
6161
f1 = os.path.join(sub, "f.txt")
6262
with open(f1, "w") as fp:
6363
fp.write("hi")
64-
pairs = plan_upload([d], "/__ext__/dst")
64+
pairs = plan_upload([d], "/mnt/dst")
6565
assert len(pairs) == 1
6666
loc, dev = pairs[0]
6767
assert loc == f1
68-
assert dev == "/__ext__/dst/a/b/f.txt"
68+
assert dev == "/mnt/dst/a/b/f.txt"
6969

7070

7171
def test_plan_upload_dedupe():
7272
with tempfile.TemporaryDirectory() as d:
7373
f = os.path.join(d, "x.bin")
7474
with open(f, "wb") as fp:
7575
fp.write(b"x")
76-
pairs = plan_upload([f, f], "/__ext__/d")
76+
pairs = plan_upload([f, f], "/mnt/d")
7777
assert len(pairs) == 1
7878

7979

@@ -88,7 +88,7 @@ def test_plan_upload_path_too_long():
8888

8989

9090
def test_split_remote_glob_pattern():
91-
assert split_remote_glob_pattern("/__ext__/bbs/*.md") == ("/__ext__/bbs", "*.md")
91+
assert split_remote_glob_pattern("/mnt/bbs/*.md") == ("/mnt/bbs", "*.md")
9292
base, rel = split_remote_glob_pattern("*.md")
9393
assert base == "/"
9494
assert rel == "*.md"
@@ -103,26 +103,26 @@ def test_remote_rel_glob_to_regex():
103103

104104
def test_plan_download_tree():
105105
rows = [
106-
("/__ext__/d/a.txt", 3),
107-
("/__ext__/d/sub/b.bin", 2),
108-
("/__ext__/d/emptydir", 0),
106+
("/mnt/d/a.txt", 3),
107+
("/mnt/d/sub/b.bin", 2),
108+
("/mnt/d/emptydir", 0),
109109
]
110110
with tempfile.TemporaryDirectory() as ld:
111-
pairs = plan_download_tree("/__ext__/d", ld, rows)
111+
pairs = plan_download_tree("/mnt/d", ld, rows)
112112
assert len(pairs) == 2
113113
by = {os.path.basename(lp): dp for dp, lp in pairs}
114-
assert by["a.txt"] == "/__ext__/d/a.txt"
115-
assert by["b.bin"] == "/__ext__/d/sub/b.bin"
114+
assert by["a.txt"] == "/mnt/d/a.txt"
115+
assert by["b.bin"] == "/mnt/d/sub/b.bin"
116116

117117

118118
def test_plan_download_glob():
119119
rows = [
120-
("/__ext__/bbs/kb/one.md", 10),
121-
("/__ext__/bbs/kb/two.txt", 5),
122-
("/__ext__/bbs/other/x.md", 3),
120+
("/mnt/bbs/kb/one.md", 10),
121+
("/mnt/bbs/kb/two.txt", 5),
122+
("/mnt/bbs/other/x.md", 3),
123123
]
124124
with tempfile.TemporaryDirectory() as ld:
125-
pairs = plan_download_glob("/__ext__/bbs/**/*.md", ld, rows)
125+
pairs = plan_download_glob("/mnt/bbs/**/*.md", ld, rows)
126126
assert len(pairs) == 2
127127
locs = sorted(lp for _dp, lp in pairs)
128128
assert locs[0].endswith(os.path.join("kb", "one.md"))

meshtastic/tests/test_node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ def test_node_upload_file_xmodem_happy_path(tmp_path):
16251625
iface = MagicMock(autospec=MeshInterface)
16261626
anode = Node(iface, 1234567890, noProto=False)
16271627
XC = xmodem_pb2.XModem
1628-
device_path = "/__ext__/t.bin"
1628+
device_path = "/t.bin"
16291629
payload = b"hello"
16301630
src = tmp_path / "src.bin"
16311631
src.write_bytes(payload)
@@ -1659,7 +1659,7 @@ def test_node_upload_file_xmodem_two_chunks(tmp_path):
16591659
iface = MagicMock(autospec=MeshInterface)
16601660
anode = Node(iface, 1234567890, noProto=False)
16611661
XC = xmodem_pb2.XModem
1662-
device_path = "/__int__/big.bin"
1662+
device_path = "/big.bin"
16631663
payload = b"Z" * 129
16641664
c0, c1 = payload[:128], payload[128:]
16651665
src = tmp_path / "src.bin"
@@ -1720,7 +1720,7 @@ def test_node_download_file_xmodem_happy_path(tmp_path):
17201720
iface = MagicMock(autospec=MeshInterface)
17211721
anode = Node(iface, 1234567890, noProto=False)
17221722
XC = xmodem_pb2.XModem
1723-
device_path = "/__ext__/r.bin"
1723+
device_path = "/r.bin"
17241724
payload = b"hi"
17251725
dst = tmp_path / "out.bin"
17261726
phase = 0
@@ -1856,7 +1856,7 @@ def fake_roundtrip(xm, timeout_s=5.0):
18561856

18571857
with patch.object(anode, "_xmodem_roundtrip", side_effect=fake_roundtrip):
18581858
with patch.object(anode, "_xmodem_send"):
1859-
rows = anode.listDir("/__ext__", depth=0)
1859+
rows = anode.listDir("/mnt", depth=0)
18601860
assert rows == [("/ok.txt", 1), ("/good.bin", 99)]
18611861

18621862

0 commit comments

Comments
 (0)