(self, db)
| 108 | |
| 109 | |
| 110 | def testUpdateJson(self, db): |
| 111 | f = io.BytesIO() |
| 112 | f.write(""" |
| 113 | { |
| 114 | "test": [ |
| 115 | {"test_id": 1, "title": "Test 1 title", "extra col": "Ignore it"} |
| 116 | ] |
| 117 | } |
| 118 | """.encode()) |
| 119 | f.seek(0) |
| 120 | assert db.updateJson(db.db_dir + "data.json", f) is True |
| 121 | assert db.execute("SELECT COUNT(*) AS num FROM test_importfilter").fetchone()["num"] == 1 |
| 122 | assert db.execute("SELECT COUNT(*) AS num FROM test").fetchone()["num"] == 1 |
| 123 | |
| 124 | def testUnsafePattern(self, db): |
| 125 | db.schema["maps"] = {"[A-Za-z.]*": db.schema["maps"]["data.json"]} # Only repetition of . supported |
nothing calls this directly
no test coverage detected