Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 377f2a1

Browse files
committed
mock mongo db client
1 parent 699cb0c commit 377f2a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import json
66
import mock
77
from mock import MagicMock, patch, mock_open
8+
import pymongo
89

910
from StringIO import StringIO
1011

@@ -14,7 +15,7 @@
1415

1516
reqmgr_url = "cmsweb.cern.ch"
1617
test_dataset = "/TTJets_mtop1695_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIIWinter15GS-MCRUN2_71_V1-v1/GEN-SIM"
17-
18+
mongo_db_docker_url = "0.0.0.0:32774"
1819

1920
class ContextualStringIO(StringIO):
2021
def __enter__(self):
@@ -38,6 +39,9 @@ def mock_make_x509_conn(url=reqmgr_url, max_try=5):
3839
return None
3940

4041

42+
def mock_mongo_client():
43+
return pymongo.MongoClient('mongodb://%s/'% mongo_db_docker_url)
44+
4145
class TestDeepUpdate(unittest.TestCase):
4246

4347
def setUp(self):

0 commit comments

Comments
 (0)