MCPcopy
hub / github.com/evalplus/evalplus / test_sanitize_class

Function test_sanitize_class

tests/test_treesitter_sanitizer.py:71–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69
70
71def test_sanitize_class():
72 icode = r"""Following is the code snippet:
73```python
74import numpy as np
75from numpy import sin, cos
76class g():
77 def hello_world():
78 return 0
79def f(x):
80 print(g.hello_world())
81 return np.tan(x)
82```
83"""
84
85 assert (
86 sanitize(icode)
87 == r"""import numpy as np
88from numpy import sin, cos
89class g():
90 def hello_world():
91 return 0
92def f(x):
93 print(g.hello_world())
94 return np.tan(x)"""
95 )
96
97
98def test_entrypoint_basic():

Callers

nothing calls this directly

Calls 1

sanitizeFunction · 0.90

Tested by

no test coverage detected