Skip to content

Commit

Permalink
Merge pull request #60 from godatadriven/add-custom-name-test
Browse files Browse the repository at this point in the history
Added test for a custom name
  • Loading branch information
ffinfo authored Apr 18, 2023
2 parents 872b556 + 5897989 commit 705dc7c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_to_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,20 @@ def test_int():
"name": "IntModel",
"fields": [{"type": "int", "name": "c1"}],
}


class CustomNameModel(AvroBase):
c1: int

class Config:
title = "some_other_name"


def test_custom_name():
result = CustomNameModel.avro_schema()
assert result == {
"type": "record",
"namespace": "some_other_name",
"name": "some_other_name",
"fields": [{"type": "long", "name": "c1"}],
}

0 comments on commit 705dc7c

Please sign in to comment.