def test_offense_record_with_slashes(report, state): string = """ CONVICTED CITY/TOWN VIOLATION (I) INFRACTION LOCAL ORDINANCE """ matches = offense.OffenseRecordRow(report, state).match(string) assert matches is not None, "Regex match failed" assert matches["desc"] == "CITY/TOWN VIOLATION (I)"
def test_offense_record_charged(report, state): string = "CHARGED SPEEDING(80 mph in a 65 mph zone) INFRACTION G.S. 20-141(B)" # noqa matches = offense.OffenseRecordRow(report, state).match(string) assert matches is not None, "Regex match failed" assert matches["action"] == "CHARGED" assert matches["desc"] == "SPEEDING(80 mph in a 65 mph zone)" assert matches["severity"] == "INFRACTION" assert matches["law"] == "G.S. 20-141(B)"
def test_offense_record_convicted(report, state): string = "CONVICTED IMPROPER EQUIP - SPEEDOMETER INFRACTION G.S. 20-123.2" # noqa matches = offense.OffenseRecordRow(report, state).match(string) assert matches is not None, "Regex match failed" assert matches["action"] == "CONVICTED" assert matches["desc"] == "IMPROPER EQUIP - SPEEDOMETER" assert matches["severity"] == "INFRACTION" assert matches["law"] == "G.S. 20-123.2"
def test_offense_record_row__enabled(section, report, state): state.offense_num = 1 state.section = section assert offense.OffenseRecordRow(report, state).is_enabled()