Skip to content

Commit

Permalink
Update Example and Import robot Builtin library
Browse files Browse the repository at this point in the history
  • Loading branch information
serhatbolsu committed Oct 18, 2015
1 parent 5743adb commit 33a7826
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/MongoDBLibrary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class MongoDBLibrary(MongoConnectionManager, MongoQuery):
+ PyMongo 3.0.3 Documentation - http://api.mongodb.org/python/3.0.3/
Notes:
Example Usage:
| # ToDo |
| Connect To MongoDB | foo.bar.org | ${27017} |
| ${QueryJSON} | Set Variable | {"name" : "username" ,"in_use": false} |
| ${UpdateJSON} | Set Variable | {"$set": {"in_use" : true}} |
| &{allResults} | Retrieve and Update One Mongodb Record | DBName | CollectionName | ${QueryJSON} | ${UpdateJSON} |
| Log | ${allResults} |
"""

ROBOT_LIBRARY_SCOPE = 'GLOBAL'
Expand Down
5 changes: 4 additions & 1 deletion src/MongoDBLibrary/mongo_connection_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from robot.libraries.BuiltIn import BuiltIn


class MongoConnectionManager(object):
Expand All @@ -10,7 +11,9 @@ def __init__(self):
Initializes _dbconnection to None.
"""
self._dbconnection = None

self._builtin = BuiltIn()


def connect_to_mongodb(self, dbHost='localhost', dbPort=27017, dbMaxPoolSize=10, dbNetworkTimeout=None,
dbDocClass=dict, dbTZAware=False):
"""
Expand Down

0 comments on commit 33a7826

Please sign in to comment.