@@ -202,14 +202,35 @@ suite('Debugging - pythonInlineProvider', () => {
202
202
} ) ;
203
203
204
204
test ( 'ProvideInlineValues function should return all the vars in the python file with self in class' , async ( ) => {
205
+ customRequestStub
206
+ . withArgs ( 'variables' , sinon . match . any )
207
+ . onFirstCall ( )
208
+ . resolves ( {
209
+ variables : [
210
+ {
211
+ name : 'self' ,
212
+ value : '<__main__.Person object at 0x10b223310>' ,
213
+ type : 'Person' ,
214
+ evaluateName : 'self' ,
215
+ variablesReference : 5 ,
216
+ } ,
217
+ ] ,
218
+ } ) ;
205
219
customRequestStub . withArgs ( 'variables' , sinon . match . any ) . resolves ( {
206
220
variables : [
207
221
{
208
- name : 'self' ,
209
- value : '<__main__.Person object at 0x10b223310>' ,
210
- type : 'Person' ,
211
- evaluateName : 'self' ,
212
- variablesReference : 5 ,
222
+ name : 'name' ,
223
+ value : "'John'" ,
224
+ type : 'str' ,
225
+ evaluateName : 'self.name' ,
226
+ variablesReference : 0 ,
227
+ } ,
228
+ {
229
+ name : 'age' ,
230
+ value : '25' ,
231
+ type : 'int' ,
232
+ evaluateName : 'self.age' ,
233
+ variablesReference : 0 ,
213
234
} ,
214
235
] ,
215
236
} ) ;
@@ -278,8 +299,8 @@ suite('Debugging - pythonInlineProvider', () => {
278
299
expect ( result ) . to . deep . equal ( expected ) ;
279
300
} ) ;
280
301
281
- test ( 'ProvideInlineValues function should return all the vars in the python file with class variables' , async ( ) => {
282
- customRequestStub . withArgs ( 'variables' , sinon . match . any ) . resolves ( {
302
+ test ( 'ProvideInlineValues function should return the vars in the python file with readable class variables' , async ( ) => {
303
+ customRequestStub . withArgs ( 'variables' , sinon . match . any ) . onFirstCall ( ) . resolves ( {
283
304
variables : [
284
305
{
285
306
name : 'person1' ,
@@ -290,6 +311,34 @@ suite('Debugging - pythonInlineProvider', () => {
290
311
} ,
291
312
] ,
292
313
} ) ;
314
+ customRequestStub . withArgs ( 'variables' , sinon . match . any ) . resolves ( {
315
+ variables : [
316
+ {
317
+ name : 'age' ,
318
+ value : '30' ,
319
+ type : 'int' ,
320
+ evaluateName : 'person1.age' ,
321
+ variablesReference : 0 ,
322
+ } ,
323
+ {
324
+ name : 'id' ,
325
+ value : '1' ,
326
+ type : 'int' ,
327
+ evaluateName : 'person1.id' ,
328
+ variablesReference : 0 ,
329
+ } ,
330
+ {
331
+ name : 'name' ,
332
+ value : "'John Doe'" ,
333
+ type : 'str' ,
334
+ evaluateName : 'person1.name' ,
335
+ variablesReference : 0 ,
336
+ presentationHint : {
337
+ attributes : [ 'rawString' ] ,
338
+ } ,
339
+ } ,
340
+ ] ,
341
+ } ) ;
293
342
const file = path . join ( WS_ROOT , 'pythonFiles' , 'testClassVarType.py' ) ;
294
343
let document = await workspace . openTextDocument ( file ) ;
295
344
const inlineValueProvider = new PythonInlineValueProvider ( ) ;
@@ -299,33 +348,6 @@ suite('Debugging - pythonInlineProvider', () => {
299
348
300
349
const result = await inlineValueProvider . provideInlineValues ( document , viewPort , context ) ;
301
350
const expected = [
302
- {
303
- range : {
304
- c : {
305
- c : 9 ,
306
- e : 0 ,
307
- } ,
308
- e : {
309
- c : 9 ,
310
- e : 7 ,
311
- } ,
312
- } ,
313
- variableName : 'person1' ,
314
- caseSensitiveLookup : false ,
315
- } ,
316
- {
317
- range : {
318
- c : {
319
- c : 10 ,
320
- e : 0 ,
321
- } ,
322
- e : {
323
- c : 10 ,
324
- e : 13 ,
325
- } ,
326
- } ,
327
- expression : 'person1.greet' ,
328
- } ,
329
351
{
330
352
range : {
331
353
c : {
0 commit comments