(file, conf)
| 490 | should_write_back = False |
| 491 | |
| 492 | def add_spec(file, conf): |
| 493 | spec = None |
| 494 | response = conf.get('response') |
| 495 | |
| 496 | status = conf.get('status') |
| 497 | if status is None: |
| 498 | status = 200 |
| 499 | |
| 500 | query = conf["query"] |
| 501 | if "query" in query: |
| 502 | query = query["query"] |
| 503 | |
| 504 | headers = conf.get("headers") |
| 505 | |
| 506 | spec = PortToHaskell.PostSpec( |
| 507 | conf.get("description"), |
| 508 | file, |
| 509 | conf["url"], |
| 510 | headers, |
| 511 | query, # TODO: handle variables |
| 512 | status, |
| 513 | response) |
| 514 | |
| 515 | PortToHaskell.with_test(hge_ctx.request.cls.__qualname__).add_spec( |
| 516 | hge_ctx.request._pyfuncitem.originalname, |
| 517 | spec) |
| 518 | |
| 519 | with open(f, 'r+') as c: |
| 520 | # ruamel will preserve order so that we can test the JSON ordering |
no test coverage detected