예제 #1
0
 def setUp(self):
     util.connect_db()
     DbDataset.objects().delete()
     DbFhirStore.objects().delete()
     DbPatient.objects().delete()
     util.create_test_dataset('awesome-dataset')
     util.create_test_fhir_store('awesome-dataset', 'awesome-fhir-store')
 def setUp(self):
     util.connect_db()
     DbDataset.objects().delete()
     DbAnnotationStore.objects().delete()
     DbAnnotation.objects().delete()
     util.create_test_dataset('awesome-dataset')
     util.create_test_annotation_store(
         'awesome-dataset', 'awesome-annotation-store')
    def test_get_dataset(self):
        """Test case for get_dataset

        Get a dataset by ID
        """
        util.create_test_dataset("awesome-dataset")
        headers = {
            'Accept': 'application/json',
        }
        response = self.client.open('/api/v1/datasets/{dataset_id}'.format(
            dataset_id='awesome-dataset'),
                                    method='GET',
                                    headers=headers)
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
    def test_list_datasets(self):
        """Test case for list_datasets

        Get all datasets
        """
        util.create_test_dataset("awesome-dataset")
        query_string = [('limit', 10), ('offset', 0)]
        headers = {
            'Accept': 'application/json',
        }
        response = self.client.open('/api/v1/datasets',
                                    method='GET',
                                    headers=headers,
                                    query_string=query_string)
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
 def setUp(self):
     util.connect_db()
     DbDataset.objects().delete()
     DbFhirStore.objects().delete()
     util.create_test_dataset('awesome-dataset')