flyshell 1.1.9__tar.gz → 1.1.11__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.
- {flyshell-1.1.9/src/flyshell.egg-info → flyshell-1.1.11}/PKG-INFO +1 -1
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/constants.py +2 -2
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/core/directory.py +4 -1
- {flyshell-1.1.9 → flyshell-1.1.11/src/flyshell.egg-info}/PKG-INFO +1 -1
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell.egg-info/SOURCES.txt +1 -0
- flyshell-1.1.11/tests/test_fs.py +30 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_utils.py +28 -20
- {flyshell-1.1.9 → flyshell-1.1.11}/LICENSE +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/README.md +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/pyproject.toml +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/setup.cfg +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/__init__.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/abstract/__init__.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/abstract/base_cmd.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/abstract/base_plugin.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/abstract/parent_cmd.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/builtin/__init__.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/builtin/diskops.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/builtin/fs.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/builtin/system.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/builtin/utils.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/core/__init__.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/core/auth.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/core/console.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/core/data.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/core/loader.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell/main.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell.egg-info/dependency_links.txt +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell.egg-info/entry_points.txt +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell.egg-info/requires.txt +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/src/flyshell.egg-info/top_level.txt +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_auth.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_data.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_directory.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_diskops.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_loader.py +0 -0
- {flyshell-1.1.9 → flyshell-1.1.11}/tests/test_security.py +0 -0
|
@@ -103,7 +103,10 @@ def _execute_single(raw_cmd: str) -> int:
|
|
|
103
103
|
if cmd_name in COMMAND_REGISTRY:
|
|
104
104
|
command = COMMAND_REGISTRY[cmd_name]
|
|
105
105
|
if isinstance(command, ParentCmd):
|
|
106
|
-
|
|
106
|
+
code, message = command.execute(args)
|
|
107
|
+
if message:
|
|
108
|
+
print(message)
|
|
109
|
+
return code
|
|
107
110
|
command.help()
|
|
108
111
|
return 0
|
|
109
112
|
elif cmd_name in c.PLUGINS:
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# tests\test_fs.py
|
|
2
|
+
|
|
3
|
+
from flyshell.builtin import fs
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_fs_parent_dispatches_subcommands():
|
|
7
|
+
parent = fs.Fs()
|
|
8
|
+
code, msg = parent.execute(["version"])
|
|
9
|
+
assert code == 0
|
|
10
|
+
assert "Flyshell Version" in msg
|
|
11
|
+
code, msg = parent.execute(["licence"])
|
|
12
|
+
assert code == 0
|
|
13
|
+
assert "MIT Licence" in msg
|
|
14
|
+
code, msg = parent.execute(["license"])
|
|
15
|
+
assert code == 0
|
|
16
|
+
assert "MIT Licence" in msg
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_fs_unknown_subcommand():
|
|
20
|
+
parent = fs.Fs()
|
|
21
|
+
code, msg = parent.execute(["unknown_cmd"])
|
|
22
|
+
assert code == 1
|
|
23
|
+
assert "Unknown subcommand" in msg
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_fs_del_requires_target():
|
|
27
|
+
del_cmd = fs.FsDel()
|
|
28
|
+
code, msg = del_cmd.execute([])
|
|
29
|
+
assert code == 1
|
|
30
|
+
assert "requires a target" in msg
|
|
@@ -38,25 +38,33 @@ def test_history_limit_and_all_args(tmp_path, monkeypatch):
|
|
|
38
38
|
lambda limit=None, filename=test_db: (
|
|
39
39
|
data.get_history.__wrapped__(limit=limit, filename=test_db)
|
|
40
40
|
if hasattr(data.get_history, "__wrapped__")
|
|
41
|
-
else
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
else (
|
|
42
|
+
[
|
|
43
|
+
entry
|
|
44
|
+
for entry in (
|
|
45
|
+
lambda conn: [
|
|
46
|
+
{"command": r[0], "timestamp": r[1]}
|
|
47
|
+
for r in conn.execute(
|
|
48
|
+
(
|
|
49
|
+
"SELECT command, timestamp FROM cmd_history ORDER BY id DESC LIMIT ?"
|
|
50
|
+
if limit and limit > 0
|
|
51
|
+
else "SELECT command, timestamp FROM cmd_history ORDER BY id ASC"
|
|
52
|
+
),
|
|
53
|
+
(limit,) if limit and limit > 0 else (),
|
|
54
|
+
).fetchall()
|
|
55
|
+
]
|
|
56
|
+
)(data._get_connection(test_db))
|
|
57
|
+
][::-1]
|
|
58
|
+
if limit and limit > 0
|
|
59
|
+
else [
|
|
60
|
+
{"command": r[0], "timestamp": r[1]}
|
|
61
|
+
for r in data._get_connection(test_db)
|
|
62
|
+
.execute(
|
|
63
|
+
"SELECT command, timestamp FROM cmd_history ORDER BY id ASC"
|
|
64
|
+
)
|
|
65
|
+
.fetchall()
|
|
66
|
+
]
|
|
67
|
+
)
|
|
60
68
|
),
|
|
61
69
|
)
|
|
62
70
|
data.append_history("cmd1", "2026-01-01T00:00:00Z", filename=test_db)
|
|
@@ -69,4 +77,4 @@ def test_history_limit_and_all_args(tmp_path, monkeypatch):
|
|
|
69
77
|
code, msg = cmd.execute(["all"])
|
|
70
78
|
assert code == 0
|
|
71
79
|
assert "cmd1" in msg
|
|
72
|
-
assert "cmd2" in msg
|
|
80
|
+
assert "cmd2" in msg
|
|
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
|