| 1644 | os.chmod(passdir, stat.S_IRWXU) |
| 1645 | |
| 1646 | async def test_connect_args_validation(self): |
| 1647 | for val in {-1, 'a', True, False, 0}: |
| 1648 | with self.assertRaisesRegex(ValueError, 'greater than 0'): |
| 1649 | await asyncpg.connect(command_timeout=val) |
| 1650 | |
| 1651 | for arg in {'max_cacheable_statement_size', |
| 1652 | 'max_cached_statement_lifetime', |
| 1653 | 'statement_cache_size'}: |
| 1654 | for val in {None, -1, True, False}: |
| 1655 | with self.assertRaisesRegex(ValueError, 'greater or equal'): |
| 1656 | await asyncpg.connect(**{arg: val}) |
| 1657 | |
| 1658 | |
| 1659 | class TestConnection(tb.ConnectedTestCase): |