()
| 128 | |
| 129 | |
| 130 | def test_entrypoint_chain(): |
| 131 | icode = r"""Following is the code snippet: |
| 132 | ```python |
| 133 | import numpy as np |
| 134 | from numpy import sin, cos |
| 135 | |
| 136 | def f(x): |
| 137 | return c(x) |
| 138 | assert f(1) == 5 |
| 139 | def g(x): |
| 140 | return cos(f(x)) |
| 141 | |
| 142 | def c(x): |
| 143 | newObj = h() |
| 144 | return x |
| 145 | |
| 146 | class h(): |
| 147 | def hello_world(): |
| 148 | return 0 |
| 149 | |
| 150 | class h(): |
| 151 | def goodbye_world(): |
| 152 | return 0 |
| 153 | |
| 154 | |
| 155 | assert g(0) == 1 |
| 156 | ``` |
| 157 | """ |
| 158 | print(sanitize(icode, "g")) |
| 159 | assert ( |
| 160 | sanitize(icode, "g") |
| 161 | == r"""import numpy as np |
| 162 | from numpy import sin, cos |
| 163 | def f(x): |
| 164 | return c(x) |
| 165 | def g(x): |
| 166 | return cos(f(x)) |
| 167 | def c(x): |
| 168 | newObj = h() |
| 169 | return x |
| 170 | class h(): |
| 171 | def hello_world(): |
| 172 | return 0""" |
| 173 | ) |
| 174 | |
| 175 | |
| 176 | def test_entrypoint_no_chain(): |
nothing calls this directly
no test coverage detected