Example #1
0
        def test_get_schema(self, atom: Atom, collection: Collection, schema: Schema):
            result_schema_class = atom.get_schema(collection, schema.get_id())
            assert isinstance(result_schema_class, Schema)
            assert result_schema_class == schema

            result_schema_str = atom.get_schema(collection.get_id(), schema.get_id())
            assert isinstance(result_schema_str, Schema)
            assert result_schema_str == schema

            assert result_schema_class == result_schema_str == schema
Example #2
0
        def test_get_schema_not_found(
            self, atom: Atom, collection: Collection, schema: Schema
        ):
            with pytest.raises(RequestFailedError):
                atom.get_schema("invalid collection id", "invalid schema id")

            with pytest.raises(RequestFailedError):
                atom.get_schema("invalid collection id", schema.get_id())

            with pytest.raises(RequestFailedError):
                atom.get_schema(collection.get_id(), "0")
Example #3
0
 def test_get_schema_param_check(self, atom: Atom):
     with pytest.raises(AssertionError):
         atom.get_schema(123, 123)