Created
April 24, 2022 10:54
-
-
Save xnuinside/decb2b726f4f119fb4760b8169fafc85 to your computer and use it in GitHub Desktop.
medium_test_code_generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_pydantic_models_generator_basic(): | |
ddl = """ | |
CREATE table user_history ( | |
runid decimal(21) null | |
) ; | |
""" | |
result = create_models(ddl, models_type="pydantic")["code"] | |
expected = """from typing import Optional | |
from pydantic import BaseModel | |
class UserHistory(BaseModel): | |
runid: Optional[float] | |
""" | |
assert result == expected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment