Esempio n. 1
0
def test_other_operator(caplog):
    matches = list(
        grep.find_in_string(
            """
        # Raincoat: pypi package: BLA>=1.2.3 path: yo/yeah.py: foo
    """, "foo/bar"))
    assert "Unrecognized Raincoat comment" in caplog.records[0].message
    assert len(matches) == 0
Esempio n. 2
0
def test_string_normal_whole_module(match_class):
    matches = list(grep.find_in_string("""
        # Raincoat: pypi package: BLA==1.2.3 path: yo/yeah.py
    """, filename="foo/bar"))

    assert len(matches) == 1
    match, = matches

    assert match.package == "BLA"
    assert match.version == "1.2.3"
    assert match.path == "yo/yeah.py"
    assert match.element == ""
    assert match.lineno == 2
    assert match.filename == "foo/bar"
Esempio n. 3
0
def test_empty():
    matches = list(grep.find_in_string("", ""))

    assert len(matches) == 0