def test_grep_line(self): string = """some text some more text following line""" p = Parser(string) assert p.grep_line("some more", nlines=1) == "some more text\nfollowing line" assert p.grep_line("wrong text") is None
def test_get_value(self): p = Parser("line to match 0.1 xxx") assert p.get_value("line to", -2, 0, float) == pytest.approx(0.1)