This repository has been archived by the owner on Jan 29, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#526] Refactor tests for the new setup and add some more
- Loading branch information
1 parent
4edf9d8
commit 9bf9144
Showing
31 changed files
with
656 additions
and
476 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
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
Empty file.
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,22 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import uuid | ||
import pytest | ||
|
||
@pytest.fixture | ||
def fda_document(conn, fda_approval, fda_file, fda_source): | ||
document = { | ||
'id': uuid.uuid1().hex, | ||
'source_id': fda_source, | ||
'name': 'Printed Labeling', | ||
'type': 'other', | ||
'fda_approval_id': fda_approval, | ||
'file_id': fda_file, | ||
'source_url': None, | ||
} | ||
document_id = conn['database']['documents'].insert(document) | ||
return document_id |
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
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,34 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import pytest | ||
import uuid | ||
|
||
|
||
@pytest.fixture | ||
def file_fixture(conn): | ||
sha1 = uuid.uuid1().hex | ||
file_record = { | ||
'id': uuid.uuid1().hex, | ||
'sha1': sha1, | ||
'source_url': ('http://example.org/file_%s.pdf' % sha1), | ||
} | ||
file_id = conn['database']['files'].insert(file_record) | ||
return file_id | ||
|
||
|
||
@pytest.fixture | ||
def fda_file(conn): | ||
sha1 = uuid.uuid1().hex | ||
file_record = { | ||
'id': uuid.uuid1().hex, | ||
'sha1': sha1, | ||
'source_url': ('http://datastore.opentrials.net/documents/fda/file_%s.pdf' % sha1), | ||
'documentcloud_id': 3154193, | ||
'pages': [], | ||
} | ||
file_id = conn['database']['files'].insert(file_record) | ||
return file_id |
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,38 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import pytest | ||
import uuid | ||
|
||
@pytest.fixture | ||
def record(conn, nct_source): | ||
record = { | ||
'id': uuid.uuid1().hex, | ||
'identifiers': {'nct': 'NCT00212927'}, | ||
'registration_date': '2005-09-13', | ||
'public_title': 'Continuity of Care and Outcomes After Discharge From Hospital', | ||
'brief_summary': None, | ||
'scientific_title': 'Patient Outcomes After Discharge From Hospital', | ||
'description': 'See above', | ||
'recruitment_status': 'not_recruiting', | ||
'eligibility_criteria': None, | ||
'first_enrollment_date': '2002-10-01', | ||
'study_type': 'Observational', | ||
'study_design': 'Prospective', | ||
'study_phase': None, | ||
'primary_outcomes': None, | ||
'secondary_outcomes': None, | ||
'has_published_results': False, | ||
'gender': 'both', | ||
'status': 'complete', | ||
'completion_date': '2006-10-13', | ||
'source_id': nct_source, | ||
'source_url': 'https://clinicaltrials.gov/ct2/show/NCT00212927', | ||
'source_data': {}, | ||
'trial_id': None, | ||
} | ||
record_id = conn['database']['records'].insert(record) | ||
return record_id |
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
This file was deleted.
Oops, something went wrong.
Empty file.
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,48 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import uuid | ||
import pytest | ||
|
||
@pytest.fixture | ||
def cochrane_review(conn): | ||
review = { | ||
'id': uuid.uuid1().hex, | ||
'study_type': 'MIX', | ||
'file_name': 'Sulpiride for schizophrenia [v9.0-For publication].rm5', | ||
'meta_source': 'http://datastore.opentrials.net/uploads/d7823d80-6f81-11e6-87af-931e370d0cf8/cochrane_schizophrenia_reviews.zip', | ||
'doi_id': '10.1002/14651858.CD001162', | ||
'study_id': 'STD-Soni-1990', | ||
'robs': [ | ||
{ | ||
'result': 'YES', | ||
'rob_id': 'QIT-02', | ||
'group_id': '', | ||
'modified': '', | ||
'rob_name': 'Allocation concealment?', | ||
'study_id': 'STD-Soni-1990', | ||
'group_name': '', 'rob_description': | ||
'Was allocation adequately concealed?', | ||
'result_description': 'A - Adequate', | ||
}, | ||
], | ||
'refs': [ | ||
{ | ||
'no': '', | ||
'pg': '233-8', | ||
'vl': '5', 'type': | ||
'JOURNAL_ARTICLE', | ||
'year': '1990', | ||
'title': 'Sulpiride in negative schizophrenia - a placebo-controlled double-blind assessment', | ||
'source': 'Human Psychopharmacology Clinical and Experimental', | ||
'authors': 'Soni SD, Mallik A, Schiff AA', | ||
'country': '', | ||
'identifiers': [], | ||
}, | ||
], | ||
} | ||
review_id = conn['warehouse']['cochrane_reviews'].insert(review) | ||
return review_id |
Oops, something went wrong.