ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / test / simulation / slash-test / testGen.py.stest.ts 307 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
import * as assert from 'assert' ;
import * as path from 'path' ;
import { Intent } from '../../../src/extension/common/constants' ;
import { IQualifiedFile, IRelativeFile } from '../../../src/platform/test/node/simulationWorkspace' ;
import { toPosixPath } from '../../../src/util/vs/base/common/extpath' ;
import { Schemas } from '../../../src/util/vs/base/common/network' ;
import { isWindows } from '../../../src/util/vs/base/common/platform' ;
import { URI
ssuite stest
simulateInlineChat
assertSomeStrings assertWorkspaceEdit fromFixture
getFileContent
title location language
testingServiceCollection
testingServiceCollection
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files length
outcome files
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files length
assert outcome files
relFile IRelativeFile outcome files
assert relFile fileName
assert outcome files
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files length
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files
assert outcome files
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files length
assert outcome files
relFile IQualifiedFile outcome files
assert relFile uri fsPath
assert relFile uri fsPath
assert outcome files
assert outcome files
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files
relFile IQualifiedFile outcome files
assert relFile uri fsPath relFile uri fsPath relFile uri fsPath
assert outcome files
assert outcome files
assert outcome files
assert outcome files
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files
assert outcome files outcome files
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
outcome type
workspaceEdits outcome edits
assert workspaceEdits length
workspaceEditUri workspaceEdits
posixPath isWindows workspaceEditUri path workspaceEditUri path
assert posixPath
description language testingServiceCollection
testingServiceCollection
workspaceFolders
path __dirname
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
outcome type
workspaceEdits outcome edits
assert workspaceEdits length
workspaceEditUri workspaceEdits
assert workspaceEditUri fsPath
assert outcome files
outcome files
title subtitle location language
testingServiceCollection
testingServiceCollection
files
queries
file
selection
query
expectedIntent Intent Tests
outcome workspace accessor
outcome
assert outcome files length
first outcome files
assert IQualifiedFile first uri scheme Schemas untitled
assert IQualifiedFile first uri path
first
}
from
'../../../src/util/vs/base/common/uri'
;
import
{
,
}
from
'../../base/stest'
;
import
{
}
from
'../inlineChatSimulator'
;
import
{
,
,
}
from
'../stestUtil'
;
import
{
}
from
'../outcomeValidators'
;
ssuite
(
{
:
'/tests'
,
:
'inline'
,
:
'python'
,
}
,
(
)
=>
{
stest
(
'py with pyproject.toml'
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
fromFixture
(
'tests/py-pyproject-toml/'
,
'src/mmath/add.py'
)
,
]
,
:
[
{
:
'src/mmath/add.py'
,
:
[
0
,
4
]
,
:
'/tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
strictEqual
(
.
.
,
1
,
'Expected one file to be created'
)
;
assertSomeStrings
(
getFileContent
(
.
[
0
]
)
,
[
'import unittest'
,
'from mmath.add import add'
,
]
,
2
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'select existing test file using *_test.py format'
,
:
'python'
,
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py_end_test'
)
)
]
,
:
[
fromFixture
(
'tests/py_end_test/'
,
'src/ex.py'
)
,
fromFixture
(
'tests/py_end_test/'
,
'tests/ex_test.py'
)
,
]
,
:
[
{
:
'src/ex.py'
,
:
[
3
,
7
]
,
:
'/tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
strictEqual
(
.
.
,
1
,
'Expected one file to be created'
)
;
.
ok
(
.
[
0
]
.
hasOwnProperty
(
'fileName'
)
)
;
const
=
<
>
.
[
0
]
;
.
strictEqual
(
.
,
'ex_test.py'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'decimal_to_fraction'
)
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'test with docstring'
,
:
'python'
,
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py_start_test'
)
)
]
,
:
[
fromFixture
(
'tests/py_start_test/'
,
'src/ex.py'
)
,
fromFixture
(
'tests/py_start_test/'
,
'tests/test_ex.py'
)
,
]
,
:
[
{
:
'src/ex.py'
,
:
[
3
,
7
]
,
:
'/tests include a docstring'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
strictEqual
(
(
getFileContent
(
.
[
0
]
)
.
match
(
/ """ / g
)
||
[
]
)
.
,
2
,
'Expected 2 instances of """ in the test file for the doc string'
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'parameterized tests'
,
:
'python'
,
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py_start_test'
)
)
]
,
:
[
fromFixture
(
'tests/py_start_test/'
,
'src/ex.py'
)
,
fromFixture
(
'tests/py_start_test/'
,
'tests/test_ex.py'
)
,
]
,
:
[
{
:
'src/ex.py'
,
:
[
3
,
7
]
,
:
'/tests make them parameterized tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'import pytest'
)
,
'Expected pytest import to be included'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'@pytest.mark.parametrize'
)
,
'Expected parameterized test decorator to be included'
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'select test folder if exists for new test files'
,
:
'python'
,
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py_start_test'
)
)
]
,
:
[
fromFixture
(
'tests/py_start_test/'
,
'src/ex.py'
)
,
fromFixture
(
'tests/py_start_test/'
,
'src/measure.py'
)
,
fromFixture
(
'tests/py_start_test/'
,
'tests/test_ex.py'
)
,
]
,
:
[
{
:
'src/measure.py'
,
:
[
1
,
3
]
,
:
'/tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
strictEqual
(
.
.
,
1
,
'Expected one file to be created'
)
;
.
ok
(
.
[
0
]
.
hasOwnProperty
(
'uri'
)
)
;
const
=
<
>
.
[
0
]
;
.
ok
(
.
.
.
endsWith
(
'/tests/'
)
,
'Expected test file to be in the existing test folder'
)
;
.
ok
(
.
.
.
endsWith
(
'/tests/measure_test.py'
)
,
'Expected test file to be named in the same style as existing test files'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'from src.measure import cm_to_inches'
)
,
'Expected correct import to be generated'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'cm_to_inches'
)
,
'Expected function to be tested to be included in the test file'
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'focal file at repo root'
,
:
'python'
,
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py_start_test'
)
)
]
,
:
[
fromFixture
(
'tests/py_repo_root/'
,
'__init__.py'
)
,
fromFixture
(
'tests/py_repo_root/'
,
'temp.py'
)
,
]
,
:
[
{
:
'temp.py'
,
:
[
1
,
24
]
,
:
'/tests make them parameterized tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
ok
(
.
[
0
]
.
hasOwnProperty
(
'uri'
)
,
'Expected test file to be a newly created file as no testing files exist'
)
;
const
=
<
>
.
[
0
]
;
.
ok
(
.
.
.
includes
(
'test'
)
&&
.
.
.
includes
(
'.py'
)
&&
.
.
.
includes
(
'temp'
)
,
'Expected test file to include "test", ".py" and the name of the focal file'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'from . import '
)
===
false
,
'Expected no "from . import" statement'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'import .'
)
===
false
,
'Expected no "import ." statement'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'convert_temperature'
)
,
'Expected to call the function from the focal file'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'import'
)
,
'Expected import to be generated as this is a new file'
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'update import statement'
,
:
'python'
,
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py_start_test'
)
)
]
,
:
[
fromFixture
(
'tests/py_start_test/'
,
'src/ex.py'
)
,
fromFixture
(
'tests/py_start_test/'
,
'tests/test_ex.py'
)
,
]
,
:
[
{
:
'src/ex.py'
,
:
[
3
,
7
]
,
:
'/tests include a docstring'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
ok
(
.
[
0
]
.
hasOwnProperty
(
'fileName'
)
,
'Expect new file created, which makes it a IRelativeFile with a fileName'
)
;
.
ok
(
(
getFileContent
(
.
[
0
]
)
.
includes
(
'from src.ex import fraction_to_decimal, decimal_to_fraction'
)
)
||
(
getFileContent
(
.
[
0
]
)
.
includes
(
'from .ex import fraction_to_decimal, decimal_to_fraction'
)
)
,
'Expected import statement to be updated with newest function.'
)
;
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'python add to existing'
,
:
'python'
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py-pyproject-toml'
)
)
]
,
:
[
fromFixture
(
'tests/py-pyproject-toml/'
,
'src/mmath/add.py'
)
,
fromFixture
(
'tests/py-pyproject-toml/'
,
'src/mmath/sub.py'
)
,
fromFixture
(
'tests/py-pyproject-toml/'
,
'src/mmath/__init__.py'
)
,
fromFixture
(
'tests/py-pyproject-toml/'
,
'tests/test_sub.py'
)
,
]
,
:
[
{
:
'src/mmath/sub.py'
,
:
[
4
,
7
]
,
:
'/tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
if
(
.
===
'workspaceEdit'
)
{
const
=
.
.
entries
(
)
;
.
strictEqual
(
.
,
1
,
'Expected exactly one file to be edited'
)
;
const
:
URI
=
[
0
]
[
0
]
;
const
=
?
toPosixPath
(
.
)
:
.
;
.
ok
(
.
endsWith
(
'tests/test_sub.py'
)
,
'Expected the URI of the first edit to end with "tests/test_sub.py"'
)
;
}
}
}
]
,
}
)
;
}
)
;
stest
(
{
:
'python correct import'
,
:
'python'
}
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
URI
.
file
(
.
join
(
,
'../test/simulation/fixtures/tests/py-extra-nested'
)
)
]
,
:
[
fromFixture
(
'tests/py-extra-nested/'
,
'focus_module/data_controllers/grocery.py'
)
,
fromFixture
(
'tests/py-extra-nested/'
,
'tests/integration/test_other.py'
)
,
fromFixture
(
'tests/py-extra-nested/'
,
'focus_module/data_controllers/__init__.py'
)
,
]
,
:
[
{
:
'focus_module/data_controllers/grocery.py'
,
:
[
6
,
8
]
,
:
'/tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
if
(
.
===
'workspaceEdit'
)
{
const
=
.
.
entries
(
)
;
.
strictEqual
(
.
,
1
,
'Expected exactly one file to be edited'
)
;
const
:
URI
=
[
0
]
[
0
]
;
.
ok
(
.
.
endsWith
(
'test_grocery.py'
)
,
'Expected the URI of the first edit to end with "tests/test_grocery.py"'
)
;
.
ok
(
getFileContent
(
.
[
0
]
)
.
includes
(
'from .grocery'
)
||
getFileContent
(
.
[
0
]
)
.
includes
(
'from . import grocery'
)
)
;
}
}
}
]
,
}
)
;
}
)
;
}
)
;
ssuite
(
{
:
'/tests'
,
:
'real world'
,
:
'inline'
,
:
'python'
,
}
,
(
)
=>
{
stest
(
'creates new test file with test method and includes method name and test method name'
,
(
)
=>
{
return
simulateInlineChat
(
,
{
:
[
fromFixture
(
'tests/py-newtest-4658/'
,
'ex.py'
)
,
]
,
:
[
{
:
'ex.py'
,
:
[
0
,
18
]
,
:
'/tests'
,
:
.
,
validate
:
async
(
,
,
)
=>
{
assertWorkspaceEdit
(
)
;
.
strictEqual
(
.
.
,
1
)
;
const
[
]
=
.
;
.
strictEqual
(
(
<
>
)
.
.
,
.
)
;
.
ok
(
(
<
>
)
.
.
.
endsWith
(
'test_ex.py'
)
)
;
assertSomeStrings
(
getFileContent
(
)
,
[
' check_skipped_condition'
,
'test_check_skipped_condition'
]
,
2
)
;
}
}
]
}
)
;
}
)
;
}
)
;