def test_set_zero_keepalive(self, psycopg2):
        self.profile['keepalives_idle'] = 0
        connection = RedshiftAdapter.acquire_connection(self.profile, 'dummy')

        psycopg2.connect.assert_called_once_with(dbname='redshift',
                                                 user='******',
                                                 host='database',
                                                 password='******',
                                                 port=5439,
                                                 connect_timeout=10)
    def test_default_keepalive(self, psycopg2):
        connection = RedshiftAdapter.acquire_connection(self.profile, 'dummy')

        psycopg2.connect.assert_called_once_with(
            dbname='redshift',
            user='******',
            host='database',
            password='******',
            port=5439,
            connect_timeout=10,
            keepalives_idle=RedshiftAdapter.DEFAULT_TCP_KEEPALIVE)