def test_parse_stream_empty(): """An empty file treats like empty array""" assert len(parse_stream(StringIO("")).changes) == 0
def test_parse_stream_json_empty_array(): assert len(parse_stream(StringIO("[]")).changes) == 0
def test_parse_stream_yaml_empty_array(): assert len(parse_stream(StringIO("---\n")).changes) == 0
def test_parse_stream_not_valid_json_or_yaml(): with pytest.raises(Exception, match=r'^not valid JSON or YAML$'): parse_stream(StringIO(NOT_VALID_YAML_OR_JSON))