def test_raw2row(self): # pattern not a list with pytest.raises(TypeError): PatternCreator.raw2row({"label": "ET1", "pattern": {"LOWER": "TEXT"}}) # label not a str with pytest.raises(TypeError): PatternCreator.raw2row({"label": 232, "pattern": [{"LOWER": "TEXT"}]}) # element not dictionary with pytest.raises(TypeError): PatternCreator.raw2row({"label": "etype", "pattern": [11]})
def test_raw2row2raw(self, raw): assert raw == PatternCreator.row2raw(PatternCreator.raw2row(raw))