Skip to content

Commit

Permalink
use URI for test mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
JunAishima authored and gwbischof committed Feb 6, 2024
1 parent 376280c commit 4fc725c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions analysisstore/test/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
TESTING_CONFIG = dict(host='localhost', port=7601,
timezone='US/Eastern', serviceport=7601,
database='astoretest{0}'.format(str(uuid.uuid4())),
mongouri='mongodb://localhost',
mongohost='localhost',
mongoport=27017)


def astore_setup():
f = os.path.dirname(os.path.realpath(__file__))
proc = Popen(["python", "../../startup.py", "--mongo-host",
TESTING_CONFIG["mongohost"],
"--mongo-port",
str(TESTING_CONFIG['mongoport']),
proc = Popen(["python", "../../startup.py",
"--mongo-uri",
str(TESTING_CONFIG['mongouri']),
"--database", TESTING_CONFIG['database'],
"--timezone", TESTING_CONFIG['timezone'],
"--service-port",
Expand All @@ -32,8 +32,7 @@ def astore_setup():
def astore_teardown(proc):
proc2 = Popen(['kill', '-9', str(proc.pid)])
ttime.sleep(5) # make sure the process is killed
conn = MongoClient(host=TESTING_CONFIG['mongohost'],
port=TESTING_CONFIG['mongoport'])
conn = MongoClient(TESTING_CONFIG['mongouri'])
conn.drop_database(TESTING_CONFIG['database'])
print('\nTearing down the server and dropping the db\n')
ttime.sleep(1.3)

0 comments on commit 4fc725c

Please sign in to comment.