netconverter-cli 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/CHANGELOG.md +9 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/PKG-INFO +1 -1
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/COMMANDS.md +1 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/pyproject.toml +1 -1
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/__init__.py +1 -1
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/commands.py +7 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/controller.py +45 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/presentation.py +32 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/tui.py +21 -0
- netconverter_cli-0.4.3/tests/test_folders_cd_ls.py +77 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/.gitignore +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/LICENSE +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/QUICK_START.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/README.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/SECURITY.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/PRIVACY.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/RELEASING.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/VERIFICATION.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/README.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/chatgpt.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/claude-ai.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/claude-code.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/claude-desktop.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/getting-access.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/docs/connect/other-assistants.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/examples/README.md +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/activity.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/api.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/backend.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/branding.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/catalog.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/clerk.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/cli.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/connect.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/credentials.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/guided.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/mcp_server.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/palette.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/privacy.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/providers.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/remote_mcp.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/setup.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/update.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/src/netconverter_cli/workspace.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/conftest.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_boundaries.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_clerk.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_clerk_host_binding.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_cli_020.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_connect_030.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_connect_031.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_download_analysis.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_inline.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_keyring_bus_017.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_mcp.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_mcp_auth_016.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_presentation.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_protocols.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_readonly_workspace.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_sessions.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_setup.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_signin_default.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_strict_view_015.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_update.py +0 -0
- {netconverter_cli-0.4.2 → netconverter_cli-0.4.3}/tests/test_vendor_error_022.py +0 -0
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.3 — 2026-10-23
|
|
4
|
+
|
|
5
|
+
- **Move between folders in the terminal app.** `/ls [FOLDER]` (or `/dir`) lists files and
|
|
6
|
+
folders with sizes, folders first, hidden files left out; it never reads file contents.
|
|
7
|
+
`/cd FOLDER` makes another folder the workspace (`~`, `..`, relative or absolute) and
|
|
8
|
+
loads that folder's own remembered jobs; a missing or read-only folder is refused and
|
|
9
|
+
nothing changes. `/pwd` shows the current folder. These are typed commands only: the
|
|
10
|
+
model cannot choose them, and the MCP bridge keeps the `--workspace` it was started with.
|
|
11
|
+
|
|
3
12
|
## 0.4.2 — 2026-10-23
|
|
4
13
|
|
|
5
14
|
- **Running from a read-only folder no longer crashes.** Started from `/` (or any folder
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: netconverter-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: NetConverter CLI — any-vendor network configuration migration, validation and optimization, and a local MCP bridge for your AI assistant
|
|
5
5
|
Project-URL: Homepage, https://netconverter.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/valeronlabs/netconverter_terminals
|
|
@@ -22,6 +22,7 @@ commands their arguments there (`/open "edge.cfg" fortinet`).
|
|
|
22
22
|
| `/validate` (`/analyze`) | Readiness, findings and parse gaps for a configuration |
|
|
23
23
|
| `/optimize` | Cleanup and optimization findings |
|
|
24
24
|
| `/open` | Choose a configuration without submitting |
|
|
25
|
+
| `/ls [FOLDER]` · `/dir` · `/cd FOLDER` · `/pwd` | List files (names and sizes) · work in another folder (`~`, `..`, relative or absolute; each folder keeps its own jobs) · show the current folder |
|
|
25
26
|
| `/jobs` · `/resume JOB_ID` · `/status` | List jobs · follow one · refresh the active job |
|
|
26
27
|
| `/download` | Save the active job's outputs beside its source, hash-verified |
|
|
27
28
|
| `/target` | Save the generated configuration and select it for `/validate` |
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "netconverter-cli"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.3"
|
|
8
8
|
description = "NetConverter CLI — any-vendor network configuration migration, validation and optimization, and a local MCP bridge for your AI assistant"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -5,6 +5,7 @@ import shlex
|
|
|
5
5
|
|
|
6
6
|
HELP = """/open "file.cfg" VENDOR_CODE (vendor codes: netconverter --json capabilities)
|
|
7
7
|
/convert {"target_vendor":"palo_alto_xml"} /validate /optimize
|
|
8
|
+
/cd FOLDER /ls [FOLDER] /dir /pwd
|
|
8
9
|
/jobs /resume [job_id] /status /target /download /allowance
|
|
9
10
|
/unused_objects /routes /interfaces /policy /nat
|
|
10
11
|
/dependencies {"object_name":"NAME"}
|
|
@@ -27,6 +28,12 @@ def execute(controller, text):
|
|
|
27
28
|
rest = rest.strip()
|
|
28
29
|
if command == "help":
|
|
29
30
|
return {"help": HELP}
|
|
31
|
+
if command == "cd":
|
|
32
|
+
return controller.change_folder(rest)
|
|
33
|
+
if command in {"ls", "dir"}:
|
|
34
|
+
return controller.list_folder(rest)
|
|
35
|
+
if command == "pwd":
|
|
36
|
+
return {"folder": str(controller.workspace.root)}
|
|
30
37
|
if command == "open":
|
|
31
38
|
parts = shlex.split(rest)
|
|
32
39
|
if len(parts) != 2:
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"""User-directed local orchestration; providers never receive this object."""
|
|
2
2
|
|
|
3
3
|
import base64
|
|
4
|
+
import os
|
|
4
5
|
import hashlib
|
|
5
6
|
import json
|
|
6
7
|
import time
|
|
7
8
|
import uuid
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
8
11
|
from .workspace import Workspace, WorkspaceError
|
|
9
12
|
from .api import APIError, Client, ExternalClient
|
|
10
13
|
from .backend import EXTERNAL_MAX_BYTES, download_external, submit_external
|
|
@@ -60,6 +63,48 @@ class Controller:
|
|
|
60
63
|
self.allowance = {}
|
|
61
64
|
self.catalog = Catalog()
|
|
62
65
|
|
|
66
|
+
# -- folders (typed by the user; never a model operation) -------------------
|
|
67
|
+
|
|
68
|
+
MAX_LISTED = 200
|
|
69
|
+
|
|
70
|
+
def _resolve_folder(self, path):
|
|
71
|
+
raw = Path(os.path.expanduser(path or "~"))
|
|
72
|
+
target = (raw if raw.is_absolute() else self.workspace.root / raw).resolve()
|
|
73
|
+
if not target.is_dir():
|
|
74
|
+
raise WorkspaceError(f"Not a folder: {target}")
|
|
75
|
+
return target
|
|
76
|
+
|
|
77
|
+
def change_folder(self, path):
|
|
78
|
+
"""/cd: make another folder the workspace and load its own job state.
|
|
79
|
+
|
|
80
|
+
Only the user can type this. It is not in the model's operation list, and the
|
|
81
|
+
MCP bridge keeps its configured root, so a prompt cannot move the boundary.
|
|
82
|
+
"""
|
|
83
|
+
target = self._resolve_folder(path)
|
|
84
|
+
if not os.access(target, os.W_OK):
|
|
85
|
+
raise WorkspaceError(f"{target} is not writable; choose a folder you own")
|
|
86
|
+
workspace = Workspace(target)
|
|
87
|
+
state = workspace.load() # refuse before switching if its state is invalid
|
|
88
|
+
self.workspace, self.state = workspace, state
|
|
89
|
+
return {"folder": str(target), "jobs_here": len(state.get("jobs", {}))}
|
|
90
|
+
|
|
91
|
+
def list_folder(self, path=""):
|
|
92
|
+
"""/ls, /dir: names and sizes only, never file contents."""
|
|
93
|
+
target = self._resolve_folder(path or ".")
|
|
94
|
+
entries = []
|
|
95
|
+
for item in target.iterdir():
|
|
96
|
+
if item.name.startswith("."):
|
|
97
|
+
continue
|
|
98
|
+
try:
|
|
99
|
+
is_dir = item.is_dir()
|
|
100
|
+
size = None if is_dir else item.stat().st_size
|
|
101
|
+
except OSError:
|
|
102
|
+
continue
|
|
103
|
+
entries.append({"name": item.name, "folder": is_dir, "bytes": size})
|
|
104
|
+
entries.sort(key=lambda e: (not e["folder"], e["name"].lower()))
|
|
105
|
+
return {"folder": str(target), "entries": entries[: self.MAX_LISTED],
|
|
106
|
+
"total": len(entries), "inside_workspace": target.is_relative_to(self.workspace.root)}
|
|
107
|
+
|
|
63
108
|
@property
|
|
64
109
|
def external(self) -> bool:
|
|
65
110
|
return self.kind == "external"
|
|
@@ -78,6 +78,11 @@ HELP_SECTIONS = [
|
|
|
78
78
|
('/optimize', 'Cleanup and optimization findings'),
|
|
79
79
|
('/open', 'Choose a configuration without submitting'),
|
|
80
80
|
]),
|
|
81
|
+
('Files', [
|
|
82
|
+
('/ls /dir [FOLDER]', 'List files and folders (names and sizes only)'),
|
|
83
|
+
('/cd FOLDER', 'Work in another folder (~, .., absolute or relative)'),
|
|
84
|
+
('/pwd', 'Show the current folder'),
|
|
85
|
+
]),
|
|
81
86
|
('Results', [
|
|
82
87
|
('/jobs', 'Your server jobs'),
|
|
83
88
|
('/resume JOB_ID', 'Follow a job and fetch its files'),
|
|
@@ -101,6 +106,33 @@ HELP_SECTIONS = [
|
|
|
101
106
|
]
|
|
102
107
|
|
|
103
108
|
|
|
109
|
+
def _size(n):
|
|
110
|
+
for unit in ('B', 'KB', 'MB', 'GB'):
|
|
111
|
+
if n < 1024 or unit == 'GB':
|
|
112
|
+
return f'{n:.0f} {unit}' if unit == 'B' else f'{n:.1f} {unit}'
|
|
113
|
+
n /= 1024
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def folder_view(listing):
|
|
117
|
+
"""/ls: folders first, then files with sizes. Names only, never contents."""
|
|
118
|
+
table = Table.grid(padding=(0, 2))
|
|
119
|
+
table.add_column(style=FG)
|
|
120
|
+
table.add_column(style=MUTED, justify='right')
|
|
121
|
+
for entry in listing['entries']:
|
|
122
|
+
if entry['folder']:
|
|
123
|
+
table.add_row(literal(entry['name'] + '/', ACCENT), '')
|
|
124
|
+
else:
|
|
125
|
+
table.add_row(literal(entry['name']), _size(entry['bytes'] or 0))
|
|
126
|
+
rows = [table] if listing['entries'] else [literal('Empty folder.', MUTED)]
|
|
127
|
+
if listing['total'] > len(listing['entries']):
|
|
128
|
+
rows.append(literal(f"Showing {len(listing['entries'])} of {listing['total']}.", MUTED))
|
|
129
|
+
hint = '/cd NAME to work there · /open "file" VENDOR to choose a configuration'
|
|
130
|
+
if not listing['inside_workspace']:
|
|
131
|
+
hint = 'Outside the current folder · /cd there before opening files'
|
|
132
|
+
rows += [Text(''), literal(hint, MUTED)]
|
|
133
|
+
return card(listing['folder'], Group(*rows))
|
|
134
|
+
|
|
135
|
+
|
|
104
136
|
def help_view():
|
|
105
137
|
table = Table.grid(padding=(0, 2))
|
|
106
138
|
table.add_column(style=ACCENT, no_wrap=True)
|
|
@@ -122,6 +122,24 @@ class Terminal(App):
|
|
|
122
122
|
'VS Code or Codex to this folder. Configurations go straight to '
|
|
123
123
|
'NetConverter; the AI sees paths and summaries.', MUTED))))
|
|
124
124
|
|
|
125
|
+
def folder_command(self, command, argument):
|
|
126
|
+
from .presentation import folder_view
|
|
127
|
+
from .workspace import WorkspaceError
|
|
128
|
+
try:
|
|
129
|
+
if command == '/cd':
|
|
130
|
+
result = self.controller.change_folder(argument)
|
|
131
|
+
self.render_context()
|
|
132
|
+
jobs = result['jobs_here']
|
|
133
|
+
self.write_note(f"Now working in {result['folder']}"
|
|
134
|
+
+ (f" · {jobs} job(s) remembered here" if jobs else ''))
|
|
135
|
+
self.write(folder_view(self.controller.list_folder('')))
|
|
136
|
+
elif command == '/pwd':
|
|
137
|
+
self.write_note(str(self.controller.workspace.root))
|
|
138
|
+
else:
|
|
139
|
+
self.write(folder_view(self.controller.list_folder(argument)))
|
|
140
|
+
except (WorkspaceError, OSError) as exc:
|
|
141
|
+
self.show_error(str(exc))
|
|
142
|
+
|
|
125
143
|
def show_error(self, message):
|
|
126
144
|
self.write(card('Next step', literal(message, FG), 'warning'))
|
|
127
145
|
|
|
@@ -324,6 +342,9 @@ class Terminal(App):
|
|
|
324
342
|
if text == '/help':
|
|
325
343
|
self.write(help_view())
|
|
326
344
|
return
|
|
345
|
+
if command in {'/cd', '/ls', '/dir', '/pwd'}:
|
|
346
|
+
self.folder_command(command, text[len(command):].strip())
|
|
347
|
+
return
|
|
327
348
|
if text == '/activity':
|
|
328
349
|
entries = activity.recent(self.controller.workspace.state_dir, 20)
|
|
329
350
|
self.write(card('Bridge activity', activity_view(entries)))
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""/cd, /ls, /dir and /pwd: the user moves between folders; the model cannot."""
|
|
2
|
+
import pytest
|
|
3
|
+
from textual.widgets import RichLog
|
|
4
|
+
|
|
5
|
+
from netconverter_cli.commands import execute
|
|
6
|
+
from netconverter_cli.providers import OPERATIONS
|
|
7
|
+
from netconverter_cli.tui import Terminal
|
|
8
|
+
from netconverter_cli.workspace import WorkspaceError
|
|
9
|
+
|
|
10
|
+
from tests.test_cli_020 import external, settle
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _tree(root):
|
|
14
|
+
(root / "site-a").mkdir()
|
|
15
|
+
(root / "site-a" / "edge.cfg").write_text("hostname SYNTHETIC-A\n")
|
|
16
|
+
(root / "notes.txt").write_text("x" * 2048)
|
|
17
|
+
(root / ".hidden").write_text("secret")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_ls_lists_folders_first_with_sizes_and_hides_dotfiles(tmp_path):
|
|
21
|
+
_tree(tmp_path)
|
|
22
|
+
controller, _ = external(tmp_path)
|
|
23
|
+
listing = execute(controller, "/ls")
|
|
24
|
+
names = [e["name"] for e in listing["entries"]]
|
|
25
|
+
assert names == ["site-a", "notes.txt"]
|
|
26
|
+
assert listing["entries"][0]["folder"] and listing["entries"][1]["bytes"] == 2048
|
|
27
|
+
assert execute(controller, "/dir site-a")["entries"][0]["name"] == "edge.cfg"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_cd_switches_the_workspace_and_its_own_job_state(tmp_path):
|
|
31
|
+
_tree(tmp_path)
|
|
32
|
+
controller, _ = external(tmp_path)
|
|
33
|
+
controller.state["jobs"]["tra_000000000001"] = {}
|
|
34
|
+
controller.workspace.store(controller.state)
|
|
35
|
+
result = execute(controller, "/cd site-a")
|
|
36
|
+
assert result["folder"] == str((tmp_path / "site-a").resolve())
|
|
37
|
+
assert controller.workspace.root == (tmp_path / "site-a").resolve()
|
|
38
|
+
assert controller.state["jobs"] == {} # each folder keeps its own jobs
|
|
39
|
+
assert execute(controller, "/pwd")["folder"] == str(controller.workspace.root)
|
|
40
|
+
back = execute(controller, "/cd ..")
|
|
41
|
+
assert back["jobs_here"] == 1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def test_cd_refuses_missing_and_readonly_folders_without_switching(tmp_path):
|
|
45
|
+
controller, _ = external(tmp_path)
|
|
46
|
+
with pytest.raises(WorkspaceError, match="Not a folder"):
|
|
47
|
+
execute(controller, "/cd nowhere")
|
|
48
|
+
locked = tmp_path / "locked"
|
|
49
|
+
locked.mkdir()
|
|
50
|
+
locked.chmod(0o500)
|
|
51
|
+
try:
|
|
52
|
+
with pytest.raises(WorkspaceError, match="not writable"):
|
|
53
|
+
execute(controller, "/cd locked")
|
|
54
|
+
finally:
|
|
55
|
+
locked.chmod(0o700)
|
|
56
|
+
assert controller.workspace.root == tmp_path.resolve()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def test_folder_commands_are_not_model_operations():
|
|
60
|
+
assert not {"cd", "ls", "dir", "pwd"} & set(OPERATIONS)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@pytest.mark.asyncio
|
|
64
|
+
async def test_tui_cd_and_ls_render_and_update_the_folder(tmp_path):
|
|
65
|
+
_tree(tmp_path)
|
|
66
|
+
controller, _ = external(tmp_path)
|
|
67
|
+
app = Terminal(controller)
|
|
68
|
+
async with app.run_test(size=(126, 41)) as pilot:
|
|
69
|
+
await settle(app, pilot)
|
|
70
|
+
app.dispatch("/ls")
|
|
71
|
+
await pilot.pause()
|
|
72
|
+
app.dispatch("/cd site-a")
|
|
73
|
+
await pilot.pause()
|
|
74
|
+
text = "\n".join(line.text for line in app.query_one(RichLog).lines)
|
|
75
|
+
assert "site-a/" in text and "notes.txt" in text and ".hidden" not in text
|
|
76
|
+
assert "Now working in" in text and "edge.cfg" in text
|
|
77
|
+
assert controller.workspace.root.name == "site-a"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|