File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3030import unittest
3131import warnings
3232from inspect import iscoroutinefunction
33+ from pathlib import Path
3334
3435from pymongo ._asyncio_task import create_task
3536
6970db_user = os .environ .get ("DB_USER" , "user" )
7071db_pwd = os .environ .get ("DB_PASSWORD" , "password" )
7172
72- CERT_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "certificates" )
73+ HERE = Path (__file__ ).absolute ()
74+ if _IS_SYNC :
75+ CERT_PATH = str (HERE .parent / "certificates" )
76+ else :
77+ CERT_PATH = str (HERE .parent .parent / "certificates" )
7378CLIENT_PEM = os .environ .get ("CLIENT_PEM" , os .path .join (CERT_PATH , "client.pem" ))
7479CA_PEM = os .environ .get ("CA_PEM" , os .path .join (CERT_PATH , "ca.pem" ))
7580
Original file line number Diff line number Diff line change 3030import unittest
3131import warnings
3232from inspect import iscoroutinefunction
33+ from pathlib import Path
3334
3435from pymongo ._asyncio_task import create_task
3536
6970db_user = os .environ .get ("DB_USER" , "user" )
7071db_pwd = os .environ .get ("DB_PASSWORD" , "password" )
7172
72- CERT_PATH = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "certificates" )
73+ HERE = Path (__file__ ).absolute ()
74+ if _IS_SYNC :
75+ CERT_PATH = str (HERE .parent / "certificates" )
76+ else :
77+ CERT_PATH = str (HERE .parent .parent / "certificates" )
7378CLIENT_PEM = os .environ .get ("CLIENT_PEM" , os .path .join (CERT_PATH , "client.pem" ))
7479CA_PEM = os .environ .get ("CA_PEM" , os .path .join (CERT_PATH , "ca.pem" ))
7580
You can’t perform that action at this time.
0 commit comments