コード例 #1
0
    def test_writes_source_without_urls(self, conn):
        source = {
            'id': 'id',
            'name': 'name',
            'type': 'other',
        }

        assert writers.write_source(conn, source) is not None
コード例 #2
0
    def test_writes_source_with_valid_source_url_and_terms_and_conditions_url(self, conn):
        source = {
            'id': 'id',
            'name': 'name',
            'type': 'other',
            'source_url': 'https://clinicaltrials.gov',
            'terms_and_conditions_url': 'https://clinicaltrials.gov/ct2/about-site/terms-conditions',
        }

        assert writers.write_source(conn, source) is not None
コード例 #3
0
    def test_skips_source_with_invalid_terms_and_conditions_url(self, conn):
        source = {
            'id': 'id',
            'name': 'name',
            'type': 'other',
            'source_url': 'http://example.org',
            'terms_and_conditions_url': 'invalid_url',
        }

        assert writers.write_source(conn, source) is None
コード例 #4
0
ファイル: test_source.py プロジェクト: opentrials/processors
    def test_writes_source_without_urls(self):
        source = {
            'id': 'id',
            'name': 'name',
            'type': 'type',
        }
        conn = _get_mock_conn()
        conn['database']['sources'].find_one.return_value = None

        assert writers.write_source(conn, source) is not None
コード例 #5
0
ファイル: test_source.py プロジェクト: opentrials/processors
    def test_writes_source_with_valid_source_url_and_terms_and_conditions_url(self):
        source = {
            'id': 'id',
            'name': 'name',
            'type': 'type',
            'source_url': 'https://clinicaltrials.gov',
            'terms_and_conditions_url': 'https://clinicaltrials.gov/ct2/about-site/terms-conditions',
        }
        conn = _get_mock_conn()
        conn['database']['sources'].find_one.return_value = None

        assert writers.write_source(conn, source) is not None
コード例 #6
0
ファイル: test_source.py プロジェクト: opentrials/processors
    def test_skips_source_with_invalid_terms_and_conditions_url(self):
        source = {
            'id': 'id',
            'name': 'name',
            'type': 'type',
            'source_url': 'http://example.org',
            'terms_and_conditions_url': 'invalid_url',
        }
        conn = _get_mock_conn()
        conn['database']['sources'].find_one.return_value = None

        assert writers.write_source(conn, source) is None