| 9 | |
| 10 | |
| 11 | class TestCaseDemoSqlite(HttpRunner): |
| 12 | config = Config("run sqlite demo") |
| 13 | |
| 14 | teststeps = [ |
| 15 | Step( |
| 16 | RunSqlRequest("执行一个sqlite demo") |
| 17 | .fetchmany("select* from student;", 5) |
| 18 | .extract() |
| 19 | .with_jmespath("[0].name", "name") |
| 20 | .validate() |
| 21 | .assert_equal( |
| 22 | "[0]", |
| 23 | { |
| 24 | "id": 1, |
| 25 | "name": "Jack", |
| 26 | "fullname": {"first_name": "Jack", "last_name": "Tomson"}, |
| 27 | }, |
| 28 | ) |
| 29 | .assert_equal("[0].fullname.first_name", "Jack") |
| 30 | ) |
| 31 | ] |
| 32 | |
| 33 | def test_start(self): |
| 34 | eg = DBEngine(db_uri="sqlite:///../data/sqlite.db") |
| 35 | self.with_db_engine(eg) |
| 36 | super().test_start() |
nothing calls this directly
no test coverage detected