Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
common_helper_mongo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
common_helper_mongo
Commits
b143b105
Commit
b143b105
authored
Oct 13, 2017
by
Peter Weidenbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unused code removed
parent
4ed86fee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
13 deletions
+0
-13
base_class_database_test.py
tests/base_class_database_test.py
+0
-3
test_aggregate.py
tests/test_aggregate.py
+0
-5
test_gridfs.py
tests/test_gridfs.py
+0
-5
No files found.
tests/base_class_database_test.py
View file @
b143b105
...
...
@@ -21,6 +21,3 @@ class MongoDbTest(unittest.TestCase):
def
add_list_test_data
(
self
):
self
.
test_collection
.
insert_one
({
"test_list"
:
[
"a"
,
"b"
,
"c"
]})
self
.
test_collection
.
insert_one
({
"test_list"
:
[
"c"
,
"d"
]})
if
__name__
==
"__main__"
:
unittest
.
main
()
tests/test_aggregate.py
View file @
b143b105
from
common_helper_mongo.aggregate
import
get_objects_and_count_of_occurrence
,
\
get_field_sum
,
get_field_average
,
get_list_of_all_values
,
\
get_list_of_all_values_and_collect_information_of_additional_field
import
unittest
from
tests.base_class_database_test
import
MongoDbTest
...
...
@@ -68,7 +67,3 @@ class TestAggregate(MongoDbTest):
self
.
add_simple_test_data
()
result
=
get_field_sum
(
self
.
test_collection
,
"$test_int"
,
match
=
{
"test_int"
:
{
"$lt"
:
5
}})
self
.
assertEqual
(
result
,
10
)
if
__name__
==
"__main__"
:
unittest
.
main
()
tests/test_gridfs.py
View file @
b143b105
import
unittest
import
gridfs
from
common_helper_mongo.gridfs
import
overwrite_file
...
...
@@ -19,7 +18,3 @@ class TestGridFS(MongoDbTest):
self
.
assertEqual
(
len
(
self
.
fs
.
list
()),
1
,
"original file not deleted"
)
changed_content
=
self
.
fs
.
find_one
({
'filename'
:
"test_file"
})
.
read
()
self
.
assertEqual
(
changed_content
,
b
'changed'
,
"content not correct"
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment