Skip to content

Commit

Permalink
tests with ssl_context
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Jan 29, 2024
1 parent b9cf921 commit 8da7788
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test_minipg.py
Expand Up @@ -23,11 +23,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
##############################################################################
import os
import unittest
import io
import decimal
import datetime
import minipg
import ssl


class TestMiniPG(unittest.TestCase):
Expand All @@ -41,11 +43,18 @@ def setUp(self):
minipg.create_database(self.database, self.host, self.user, self.password)
except Exception:
pass
if not os.environ.get("GITHUB_ACTIONS"):
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
else:
ssl_context = None
self.connection = minipg.connect(
host=self.host,
user=self.user,
password=self.password,
database=self.database,
ssl_context=ssl_context,
)

def tearDown(self):
Expand Down

0 comments on commit 8da7788

Please sign in to comment.