-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jerry
committed
Sep 11, 2021
1 parent
65c5e3f
commit 21679fe
Showing
4 changed files
with
187 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,5 @@ config.py | |
/config | ||
/config_ | ||
!/tests/web/handlers/config.py | ||
!/tests/hub/hubdb/config.py | ||
.hubdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
HUB_DB_BACKEND = { | ||
"module": "biothings.utils.es", | ||
"host": "localhost:9200" | ||
} | ||
|
||
# db containing the following (internal use) | ||
DATA_HUB_DB_DATABASE = "biothings" | ||
# for metadata of each src collections | ||
DATA_SRC_MASTER_COLLECTION = 'src_master' | ||
# for src data download information | ||
DATA_SRC_DUMP_COLLECTION = 'src_dump' | ||
# for src data build information | ||
DATA_SRC_BUILD_COLLECTION = 'src_build' | ||
# for src data build configuration | ||
DATA_SRC_BUILD_CONFIG_COLLECTION = 'src_build_config' | ||
# for data plugins information | ||
DATA_PLUGIN_COLLECTION = 'data_plugin' | ||
# for api information (running under hub control) | ||
API_COLLECTION = 'api' | ||
EVENT_COLLECTION = "event" | ||
CMD_COLLECTION = "cmd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" | ||
(biothings) PS C:\Users\...\biothings.api\tests\hub\hubdb> python | ||
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32 | ||
Type "help", "copyright", "credits" or "license" for more information. | ||
>>> from biothings.hub import config | ||
>>> from biothings.utils import hub_db | ||
>>> src_build = hub_db.get_src_build() | ||
>>> src_build.insert_one({"_id": "one", "comment": "hi"}) | ||
>>> src_build.find_one({"comment": "hi"}) | ||
>>> src_build.replace_one({"_id": "one"}, {"extra": "ok"}) | ||
As of 9/10/2021, hub_db module relies on biothings.hub import, | ||
this makes unit testing a single backend without a config file | ||
difficult. The command above is the easiest approach to run it. | ||
""" |