|
0981a08…
|
noreply
|
1 |
"""Tests for the CLI commands (help text, version, option presence).""" |
|
0981a08…
|
noreply
|
2 |
|
|
0981a08…
|
noreply
|
3 |
from click.testing import CliRunner |
|
0981a08…
|
noreply
|
4 |
|
|
0981a08…
|
noreply
|
5 |
from video_processor.cli.commands import cli |
|
0981a08…
|
noreply
|
6 |
|
|
0981a08…
|
noreply
|
7 |
|
|
0981a08…
|
noreply
|
8 |
class TestCLIRoot: |
|
0981a08…
|
noreply
|
9 |
def test_version(self): |
|
0981a08…
|
noreply
|
10 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
11 |
result = runner.invoke(cli, ["--version"]) |
|
0981a08…
|
noreply
|
12 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
13 |
assert "PlanOpticon" in result.output |
|
c461c78…
|
noreply
|
14 |
assert "0.5.0" in result.output # matches @click.version_option |
|
0981a08…
|
noreply
|
15 |
|
|
0981a08…
|
noreply
|
16 |
def test_help(self): |
|
0981a08…
|
noreply
|
17 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
18 |
result = runner.invoke(cli, ["--help"]) |
|
0981a08…
|
noreply
|
19 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
20 |
assert "PlanOpticon" in result.output |
|
0981a08…
|
noreply
|
21 |
assert "analyze" in result.output |
|
0981a08…
|
noreply
|
22 |
assert "query" in result.output |
|
0981a08…
|
noreply
|
23 |
assert "agent" in result.output |
|
0981a08…
|
noreply
|
24 |
assert "kg" in result.output |
|
0981a08…
|
noreply
|
25 |
assert "gws" in result.output |
|
0981a08…
|
noreply
|
26 |
assert "m365" in result.output |
|
0981a08…
|
noreply
|
27 |
assert "recordings" in result.output |
|
0981a08…
|
noreply
|
28 |
assert "ingest" in result.output |
|
0981a08…
|
noreply
|
29 |
assert "batch" in result.output |
|
0981a08…
|
noreply
|
30 |
assert "--chat" in result.output |
|
0981a08…
|
noreply
|
31 |
assert "--interactive" in result.output |
|
0981a08…
|
noreply
|
32 |
assert "companion" in result.output |
|
0981a08…
|
noreply
|
33 |
|
|
0981a08…
|
noreply
|
34 |
|
|
0981a08…
|
noreply
|
35 |
class TestAnalyzeHelp: |
|
0981a08…
|
noreply
|
36 |
def test_help(self): |
|
0981a08…
|
noreply
|
37 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
38 |
result = runner.invoke(cli, ["analyze", "--help"]) |
|
0981a08…
|
noreply
|
39 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
40 |
assert "--input" in result.output or "-i" in result.output |
|
0981a08…
|
noreply
|
41 |
assert "--output" in result.output or "-o" in result.output |
|
0981a08…
|
noreply
|
42 |
assert "--depth" in result.output |
|
0981a08…
|
noreply
|
43 |
assert "--provider" in result.output |
|
0981a08…
|
noreply
|
44 |
assert "--output-format" in result.output |
|
0981a08…
|
noreply
|
45 |
assert "--templates-dir" in result.output |
|
0981a08…
|
noreply
|
46 |
assert "--speakers" in result.output |
|
0981a08…
|
noreply
|
47 |
assert "--vision-model" in result.output |
|
0981a08…
|
noreply
|
48 |
assert "--chat-model" in result.output |
|
0981a08…
|
noreply
|
49 |
assert "--sampling-rate" in result.output |
|
0981a08…
|
noreply
|
50 |
assert "--change-threshold" in result.output |
|
0981a08…
|
noreply
|
51 |
assert "--periodic-capture" in result.output |
|
0981a08…
|
noreply
|
52 |
|
|
0981a08…
|
noreply
|
53 |
|
|
0981a08…
|
noreply
|
54 |
class TestQueryHelp: |
|
0981a08…
|
noreply
|
55 |
def test_help(self): |
|
0981a08…
|
noreply
|
56 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
57 |
result = runner.invoke(cli, ["query", "--help"]) |
|
0981a08…
|
noreply
|
58 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
59 |
assert "--db-path" in result.output |
|
0981a08…
|
noreply
|
60 |
assert "--mode" in result.output |
|
0981a08…
|
noreply
|
61 |
assert "--format" in result.output |
|
0981a08…
|
noreply
|
62 |
assert "--interactive" in result.output or "-I" in result.output |
|
0981a08…
|
noreply
|
63 |
assert "--provider" in result.output |
|
0981a08…
|
noreply
|
64 |
assert "--chat-model" in result.output |
|
0981a08…
|
noreply
|
65 |
assert "QUESTION" in result.output |
|
0981a08…
|
noreply
|
66 |
|
|
0981a08…
|
noreply
|
67 |
|
|
0981a08…
|
noreply
|
68 |
class TestAgentHelp: |
|
0981a08…
|
noreply
|
69 |
def test_help(self): |
|
0981a08…
|
noreply
|
70 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
71 |
result = runner.invoke(cli, ["agent", "--help"]) |
|
0981a08…
|
noreply
|
72 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
73 |
assert "--kb" in result.output |
|
0981a08…
|
noreply
|
74 |
assert "--interactive" in result.output or "-I" in result.output |
|
0981a08…
|
noreply
|
75 |
assert "--export" in result.output |
|
0981a08…
|
noreply
|
76 |
assert "--provider" in result.output |
|
0981a08…
|
noreply
|
77 |
assert "--chat-model" in result.output |
|
0981a08…
|
noreply
|
78 |
assert "REQUEST" in result.output |
|
0981a08…
|
noreply
|
79 |
|
|
0981a08…
|
noreply
|
80 |
|
|
0981a08…
|
noreply
|
81 |
class TestKGHelp: |
|
0981a08…
|
noreply
|
82 |
def test_help(self): |
|
0981a08…
|
noreply
|
83 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
84 |
result = runner.invoke(cli, ["kg", "--help"]) |
|
0981a08…
|
noreply
|
85 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
86 |
assert "convert" in result.output |
|
0981a08…
|
noreply
|
87 |
assert "Knowledge graph" in result.output |
|
0981a08…
|
noreply
|
88 |
|
|
0981a08…
|
noreply
|
89 |
def test_convert_help(self): |
|
0981a08…
|
noreply
|
90 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
91 |
result = runner.invoke(cli, ["kg", "convert", "--help"]) |
|
0981a08…
|
noreply
|
92 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
93 |
assert "SOURCE_PATH" in result.output |
|
0981a08…
|
noreply
|
94 |
assert "DEST_PATH" in result.output |
|
0981a08…
|
noreply
|
95 |
|
|
0981a08…
|
noreply
|
96 |
|
|
0981a08…
|
noreply
|
97 |
class TestIngestHelp: |
|
0981a08…
|
noreply
|
98 |
def test_help(self): |
|
0981a08…
|
noreply
|
99 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
100 |
result = runner.invoke(cli, ["ingest", "--help"]) |
|
0981a08…
|
noreply
|
101 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
102 |
assert "INPUT_PATH" in result.output |
|
0981a08…
|
noreply
|
103 |
assert "--output" in result.output or "-o" in result.output |
|
0981a08…
|
noreply
|
104 |
assert "--db-path" in result.output |
|
0981a08…
|
noreply
|
105 |
assert "--recursive" in result.output |
|
0981a08…
|
noreply
|
106 |
assert "--provider" in result.output |
|
0981a08…
|
noreply
|
107 |
assert "--chat-model" in result.output |
|
0981a08…
|
noreply
|
108 |
|
|
0981a08…
|
noreply
|
109 |
|
|
0981a08…
|
noreply
|
110 |
class TestBatchHelp: |
|
0981a08…
|
noreply
|
111 |
def test_help(self): |
|
0981a08…
|
noreply
|
112 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
113 |
result = runner.invoke(cli, ["batch", "--help"]) |
|
0981a08…
|
noreply
|
114 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
115 |
assert "--input-dir" in result.output or "-i" in result.output |
|
0981a08…
|
noreply
|
116 |
assert "--output" in result.output or "-o" in result.output |
|
0981a08…
|
noreply
|
117 |
assert "--depth" in result.output |
|
0981a08…
|
noreply
|
118 |
assert "--pattern" in result.output |
|
0981a08…
|
noreply
|
119 |
assert "--source" in result.output |
|
0981a08…
|
noreply
|
120 |
assert "--folder-id" in result.output |
|
0981a08…
|
noreply
|
121 |
|
|
0981a08…
|
noreply
|
122 |
|
|
0981a08…
|
noreply
|
123 |
class TestAgentAnalyzeHelp: |
|
0981a08…
|
noreply
|
124 |
def test_help(self): |
|
0981a08…
|
noreply
|
125 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
126 |
result = runner.invoke(cli, ["agent-analyze", "--help"]) |
|
0981a08…
|
noreply
|
127 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
128 |
assert "--input" in result.output or "-i" in result.output |
|
0981a08…
|
noreply
|
129 |
assert "--output" in result.output or "-o" in result.output |
|
0981a08…
|
noreply
|
130 |
assert "--depth" in result.output |
|
0981a08…
|
noreply
|
131 |
assert "--provider" in result.output |
|
0981a08…
|
noreply
|
132 |
|
|
0981a08…
|
noreply
|
133 |
|
|
0981a08…
|
noreply
|
134 |
class TestListModelsHelp: |
|
0981a08…
|
noreply
|
135 |
def test_help(self): |
|
0981a08…
|
noreply
|
136 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
137 |
result = runner.invoke(cli, ["list-models", "--help"]) |
|
0981a08…
|
noreply
|
138 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
139 |
assert "Discover" in result.output or "models" in result.output |
|
0981a08…
|
noreply
|
140 |
|
|
0981a08…
|
noreply
|
141 |
|
|
0981a08…
|
noreply
|
142 |
class TestClearCacheHelp: |
|
0981a08…
|
noreply
|
143 |
def test_help(self): |
|
0981a08…
|
noreply
|
144 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
145 |
result = runner.invoke(cli, ["clear-cache", "--help"]) |
|
0981a08…
|
noreply
|
146 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
147 |
assert "--cache-dir" in result.output |
|
0981a08…
|
noreply
|
148 |
assert "--older-than" in result.output |
|
0981a08…
|
noreply
|
149 |
assert "--all" in result.output |
|
0981a08…
|
noreply
|
150 |
|
|
0981a08…
|
noreply
|
151 |
|
|
0981a08…
|
noreply
|
152 |
class TestGWSHelp: |
|
0981a08…
|
noreply
|
153 |
def test_help(self): |
|
0981a08…
|
noreply
|
154 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
155 |
result = runner.invoke(cli, ["gws", "--help"]) |
|
0981a08…
|
noreply
|
156 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
157 |
assert "list" in result.output |
|
0981a08…
|
noreply
|
158 |
assert "fetch" in result.output |
|
0981a08…
|
noreply
|
159 |
assert "ingest" in result.output |
|
0981a08…
|
noreply
|
160 |
|
|
0981a08…
|
noreply
|
161 |
def test_list_help(self): |
|
0981a08…
|
noreply
|
162 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
163 |
result = runner.invoke(cli, ["gws", "list", "--help"]) |
|
0981a08…
|
noreply
|
164 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
165 |
assert "--folder-id" in result.output |
|
0981a08…
|
noreply
|
166 |
assert "--query" in result.output |
|
0981a08…
|
noreply
|
167 |
|
|
0981a08…
|
noreply
|
168 |
def test_ingest_help(self): |
|
0981a08…
|
noreply
|
169 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
170 |
result = runner.invoke(cli, ["gws", "ingest", "--help"]) |
|
0981a08…
|
noreply
|
171 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
172 |
assert "--folder-id" in result.output |
|
0981a08…
|
noreply
|
173 |
assert "--doc-id" in result.output |
|
0981a08…
|
noreply
|
174 |
assert "--db-path" in result.output |
|
0981a08…
|
noreply
|
175 |
|
|
0981a08…
|
noreply
|
176 |
|
|
0981a08…
|
noreply
|
177 |
class TestM365Help: |
|
0981a08…
|
noreply
|
178 |
def test_help(self): |
|
0981a08…
|
noreply
|
179 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
180 |
result = runner.invoke(cli, ["m365", "--help"]) |
|
0981a08…
|
noreply
|
181 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
182 |
assert "list" in result.output |
|
0981a08…
|
noreply
|
183 |
assert "fetch" in result.output |
|
0981a08…
|
noreply
|
184 |
assert "ingest" in result.output |
|
0981a08…
|
noreply
|
185 |
|
|
0981a08…
|
noreply
|
186 |
def test_list_help(self): |
|
0981a08…
|
noreply
|
187 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
188 |
result = runner.invoke(cli, ["m365", "list", "--help"]) |
|
0981a08…
|
noreply
|
189 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
190 |
assert "--web-url" in result.output |
|
0981a08…
|
noreply
|
191 |
assert "--folder-url" in result.output |
|
0981a08…
|
noreply
|
192 |
assert "--recursive" in result.output |
|
0981a08…
|
noreply
|
193 |
|
|
0981a08…
|
noreply
|
194 |
def test_ingest_help(self): |
|
0981a08…
|
noreply
|
195 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
196 |
result = runner.invoke(cli, ["m365", "ingest", "--help"]) |
|
0981a08…
|
noreply
|
197 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
198 |
assert "--web-url" in result.output |
|
0981a08…
|
noreply
|
199 |
assert "--file-id" in result.output |
|
0981a08…
|
noreply
|
200 |
assert "--db-path" in result.output |
|
0981a08…
|
noreply
|
201 |
|
|
0981a08…
|
noreply
|
202 |
|
|
0981a08…
|
noreply
|
203 |
class TestRecordingsHelp: |
|
0981a08…
|
noreply
|
204 |
def test_group_help(self): |
|
0981a08…
|
noreply
|
205 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
206 |
result = runner.invoke(cli, ["recordings", "--help"]) |
|
0981a08…
|
noreply
|
207 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
208 |
assert "zoom-list" in result.output |
|
0981a08…
|
noreply
|
209 |
assert "teams-list" in result.output |
|
0981a08…
|
noreply
|
210 |
assert "meet-list" in result.output |
|
0981a08…
|
noreply
|
211 |
|
|
0981a08…
|
noreply
|
212 |
def test_zoom_list_help(self): |
|
0981a08…
|
noreply
|
213 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
214 |
result = runner.invoke(cli, ["recordings", "zoom-list", "--help"]) |
|
0981a08…
|
noreply
|
215 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
216 |
assert "ZOOM_CLIENT_ID" in result.output |
|
0981a08…
|
noreply
|
217 |
|
|
0981a08…
|
noreply
|
218 |
def test_teams_list_help(self): |
|
0981a08…
|
noreply
|
219 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
220 |
result = runner.invoke(cli, ["recordings", "teams-list", "--help"]) |
|
0981a08…
|
noreply
|
221 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
222 |
assert "--user-id" in result.output |
|
0981a08…
|
noreply
|
223 |
|
|
0981a08…
|
noreply
|
224 |
def test_meet_list_help(self): |
|
0981a08…
|
noreply
|
225 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
226 |
result = runner.invoke(cli, ["recordings", "meet-list", "--help"]) |
|
0981a08…
|
noreply
|
227 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
228 |
assert "--folder-id" in result.output |
|
0981a08…
|
noreply
|
229 |
|
|
0981a08…
|
noreply
|
230 |
|
|
0981a08…
|
noreply
|
231 |
class TestAuthHelp: |
|
0981a08…
|
noreply
|
232 |
def test_help(self): |
|
0981a08…
|
noreply
|
233 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
234 |
result = runner.invoke(cli, ["auth", "--help"]) |
|
0981a08…
|
noreply
|
235 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
236 |
assert "google" in result.output |
|
0981a08…
|
noreply
|
237 |
assert "dropbox" in result.output |
|
0981a08…
|
noreply
|
238 |
assert "zoom" in result.output |
|
0981a08…
|
noreply
|
239 |
assert "notion" in result.output |
|
0981a08…
|
noreply
|
240 |
assert "github" in result.output |
|
0981a08…
|
noreply
|
241 |
assert "microsoft" in result.output |
|
0981a08…
|
noreply
|
242 |
assert "--logout" in result.output |
|
0981a08…
|
noreply
|
243 |
|
|
0981a08…
|
noreply
|
244 |
|
|
0981a08…
|
noreply
|
245 |
class TestCompanionHelp: |
|
0981a08…
|
noreply
|
246 |
def test_help(self): |
|
0981a08…
|
noreply
|
247 |
runner = CliRunner() |
|
0981a08…
|
noreply
|
248 |
result = runner.invoke(cli, ["companion", "--help"]) |
|
0981a08…
|
noreply
|
249 |
assert result.exit_code == 0 |
|
0981a08…
|
noreply
|
250 |
assert "--kb" in result.output |
|
0981a08…
|
noreply
|
251 |
assert "--provider" in result.output |
|
0981a08…
|
noreply
|
252 |
assert "--chat-model" in result.output |