Lowers cases by flag or when -h is present CLI :: --[no-]lower
(capfd, hello_world_f77, monkeypatch)
| 356 | |
| 357 | |
| 358 | def test_lower_cmod(capfd, hello_world_f77, monkeypatch): |
| 359 | """Lowers cases by flag or when -h is present |
| 360 | |
| 361 | CLI :: --[no-]lower |
| 362 | """ |
| 363 | foutl = get_io_paths(hello_world_f77, mname="test") |
| 364 | ipath = foutl.finp |
| 365 | capshi = re.compile(r"HI\(\)") |
| 366 | capslo = re.compile(r"hi\(\)") |
| 367 | # Case I: --lower is passed |
| 368 | monkeypatch.setattr(sys, "argv", f'f2py {ipath} -m test --lower'.split()) |
| 369 | with util.switchdir(ipath.parent): |
| 370 | f2pycli() |
| 371 | out, _ = capfd.readouterr() |
| 372 | assert capslo.search(out) is not None |
| 373 | assert capshi.search(out) is None |
| 374 | # Case II: --no-lower is passed |
| 375 | monkeypatch.setattr(sys, "argv", |
| 376 | f'f2py {ipath} -m test --no-lower'.split()) |
| 377 | with util.switchdir(ipath.parent): |
| 378 | f2pycli() |
| 379 | out, _ = capfd.readouterr() |
| 380 | assert capslo.search(out) is None |
| 381 | assert capshi.search(out) is not None |
| 382 | |
| 383 | |
| 384 | def test_lower_sig(capfd, hello_world_f77, monkeypatch): |
nothing calls this directly
no test coverage detected