File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,14 @@ def test_serialize_without_definition(self):
52
52
schema .serialize ({})
53
53
54
54
def test_unsupported_version_lsst (self ):
55
+ # LSST schema versions are retrieved from the avro header.
56
+ # Write an avro header with an unsupported version_id.
55
57
unsuported_version_id = 601
56
- # LSST schemas get the version from the alert bytes.
57
- # Write an avro header with the unsupported version_id.
58
58
fout = io .BytesIO ()
59
59
fout .write (b"\x00 " )
60
60
fout .write (struct .pack (">i" , unsuported_version_id ))
61
61
# Try to load the schema definition and show that it raises an error.
62
- schema = pittgoogle .Alert .from_dict ({"key" : "value" }, schema_name = "lsst" ).schema
63
62
with pytest .raises (pittgoogle .exceptions .SchemaError , match = "Schema definition not found" ):
64
- schema ._init_from_bytes (schema = schema , alert_bytes = fout .getvalue ())
63
+ pittgoogle .Alert .from_msg (
64
+ pittgoogle .types_ .PubsubMessageLike (data = fout .getvalue ()), schema_name = "lsst"
65
+ )
You can’t perform that action at this time.
0 commit comments