Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kis_tools
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sdc
kis_tools
Commits
007b30d9
Commit
007b30d9
authored
5 years ago
by
Carl Schaffer
Browse files
Options
Downloads
Patches
Plain Diff
fixing chrotel tests finally
parent
833d0e12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!88
Gris coordinate verification
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_chrotel.py
+12
-7
12 additions, 7 deletions
tests/test_chrotel.py
with
12 additions
and
7 deletions
tests/test_chrotel.py
+
12
−
7
View file @
007b30d9
...
...
@@ -5,11 +5,11 @@
Created by schaffer at 8/22/19
"""
from
argparse
import
Namespace
from
unittest
import
TestCase
from
unittest.mock
import
patch
from
main.chrotel_importer
import
main
from
bson
import
ObjectId
from
chrotel.ChrotelMongoClient
import
ChrotelMongoClient
from
sdc_importer.bbi.settings
import
get_settings
from
sdc_importer.generic
import
SDCMongoClient
...
...
@@ -24,11 +24,16 @@ class TestChroTel(TestCase):
cls
.
settings
=
get_settings
(
"
chrotel
"
)
def
test_chrotel_importer
(
self
):
with
patch
(
'
argparse.ArgumentParser.parse_args
'
,
return_value
=
Namespace
(
database
=
'
sdc_test
'
,
error_dir
=
'
/dat/schaffer/projects/sdc_importer/tests
'
,
folder
=
'
/dat/sdc/testing_data_for_importer/chrotel/lev1.0/fits/2018/11/30
'
,
force_import
=
True
,
server
=
'
localhost:27017
'
)):
main
()
mongo_client
=
ChrotelMongoClient
(
'
localhost:27017
'
,
'
foo
'
)
mongo_client
.
ignore_version_mismatch
=
True
dummy_id
=
ObjectId
(
'
5dad6165636b4a1aa71eb48c
'
)
with
patch
.
object
(
mongo_client
,
'
write_to_gridfs
'
,
return_value
=
dummy_id
)
as
gfs_patched
:
with
patch
.
object
(
mongo_client
,
'
write_to_collection
'
,
return_value
=
dummy_id
)
as
coll_patched
:
with
patch
.
object
(
mongo_client
.
obstarget
,
'
find_one
'
,
return_value
=
{
'
movie_id
'
:
dummy_id
}):
mongo_client
.
import_files
(
_testing_data_folder
)
print
(
coll_patched
,
gfs_patched
)
mongo_client
.
close
()
def
test_header_conversion
(
self
):
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment