def test_connect(self):

        # Attempt to connect as ordinary user.
        try:
            conn = dbutil.TESTSERVER.connect(self.TEST_CONNECT_DB)
        except psycopg2.Error as err:
            self.fail("Unable to connect as user '%s'" %
                      dbutil.TESTSERVER.user +
                      ((":\n" + err.pgerr) if err.pgerr else ""))
        else:
            conn.close()

        # Attempt to connect as superuser.
        try:
            conn = dbutil.TESTSERVER.connect(self.TEST_CONNECT_DB,
                                             superuser=True)
        except psycopg2.Error as err:
            self.fail("Unable to connect as superuser '%s'" %
                      dbutil.TESTSERVER.superuser +
                      ((":\n" + err.pgerr) if err.pgerr else ""))
        else:
            conn.close()
Return True if the BLE adapter is powered up, otherwise return False.
dataset/ETHPy150Open GeoscienceAustralia/agdc/tests/test_dbutil.py/TestServer.test_connect--crossover with--dataset/ETHPy150Open adafruit/Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/adapter.py/BluezAdapter.is_powered