(self)
| 35 | |
| 36 | class TestExamples(unittest.TestCase): |
| 37 | def test_funcs(self): |
| 38 | hello = lambda name: db.execute("select hello(?)", [name]).fetchone()[0] |
| 39 | self.assertEqual(hello('world'), "hello, world!") |
| 40 | self.assertEqual(hello(None), "hello, !") |
| 41 | self.assertEqual(hello(1234), "hello, 1234!") |
| 42 | self.assertEqual(hello("null: x\0x"), "hello, null: x\0x!") |
| 43 | #hello("x" * (2_147_483_647 - len("hello, !") - 20) ) |
| 44 | #hello("x" * (200) ) |
| 45 | |
| 46 | if __name__ == '__main__': |
| 47 | unittest.main() |