Test connection to Postgres database
(self)
| 908 | self.schema = custom_schema |
| 909 | |
| 910 | def test_connection(self): |
| 911 | |
| 912 | """Test connection to Postgres database""" |
| 913 | test = True |
| 914 | |
| 915 | try: |
| 916 | # try to open and close connection |
| 917 | test_connection = _PGConnect().connect() |
| 918 | test_connection.close() |
| 919 | except: |
| 920 | # if error, then catch and fail test |
| 921 | test = False |
| 922 | |
| 923 | return test |
| 924 | |
| 925 | def safe_name(self, input_name): |
| 926 |
no test coverage detected