(context, case)
| 319 | ) |
| 320 | |
| 321 | def nest_case(context, case): |
| 322 | # Detect indentation |
| 323 | lines = context.strip().splitlines() |
| 324 | prefix_len = 0 |
| 325 | for c in lines[-1]: |
| 326 | if c != " ": |
| 327 | break |
| 328 | prefix_len += 1 |
| 329 | |
| 330 | indented_case = indent(case, " " * (prefix_len + 4)) |
| 331 | return context + "\n" + indented_case |
| 332 | |
| 333 | # Gather and run the tests |
| 334 |