MCPcopy
hub / github.com/fastapi/sqlmodel / test_tutorial

Function test_tutorial

tests/test_tutorial/test_insert/test_tutorial002.py:21–40  ·  view source on GitHub ↗
(mod: ModuleType)

Source from the content-addressed store, hash-verified

19
20
21def test_tutorial(mod: ModuleType):
22 mod.main()
23 with Session(mod.engine) as session:
24 heroes = session.exec(select(mod.Hero)).all()
25 heroes_by_name = {hero.name: hero for hero in heroes}
26 deadpond = heroes_by_name["Deadpond"]
27 spider_boy = heroes_by_name["Spider-Boy"]
28 rusty_man = heroes_by_name["Rusty-Man"]
29 assert deadpond.name == "Deadpond"
30 assert deadpond.age is None
31 assert deadpond.id is not None
32 assert deadpond.secret_name == "Dive Wilson"
33 assert spider_boy.name == "Spider-Boy"
34 assert spider_boy.age is None
35 assert spider_boy.id is not None
36 assert spider_boy.secret_name == "Pedro Parqueador"
37 assert rusty_man.name == "Rusty-Man"
38 assert rusty_man.age == 48
39 assert rusty_man.id is not None
40 assert rusty_man.secret_name == "Tommy Sharp"

Callers

nothing calls this directly

Calls 3

SessionClass · 0.90
selectFunction · 0.90
execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…