Example #1
0
    def test_update_dataset(self):
        data = get_minimal_dataset_template()
        status, dataset = metax.create_dataset(data)
        self.assertIn(status, self.OK, "could not create dataset")

        dataset['research_dataset']['title']['en'] = 'title updated'
        status, updated_data = metax.update_dataset(dataset['id'], dataset)
        self.assertIn(status, self.OK, "Metax update failure")
        urn = updated_data["identifier"]
        etsin_status, etsin_data = etsin.view_dataset(urn)
        self.assertIn(etsin_status, self.OK, "Etsin failure")
Example #2
0
    def test_delete_dataset(self):
        data = get_minimal_dataset_template()

        status, cdata = metax.create_dataset(data)
        self.assertIn(status, self.OK, "could not create dataset")
        urn = cdata["identifier"]

        time.sleep(2)
        status = metax.delete_dataset(cdata['id'])
        self.assertIn(status, self.OK, "Metax dataset delete failure")

        etsin_status, etsin_data = etsin.view_dataset(urn)
Example #3
0
    def test_create_dataset(self):
        # loading the example dataset

        data = get_minimal_dataset_template()
        status, cdata = metax.create_dataset(data)

        self.assertIn(status, self.OK, "could not create dataset")
        urn = cdata["identifier"]
        time.sleep(10)

        etsin_status, etsin_data = etsin.view_dataset(urn)
        self.assertIn(etsin_status, self.OK, "Etsin could not found the dataset")
Example #4
0
    def test_update_dataset(self):
        data = load_json_file('basic_dataset.json')
        status, dataset = metax.create_dataset(data)
        self.assertIn(status, self.OK, "could not create dataset")

        # data = load_json_file('metax_dataset.json')
        dataset['research_dataset']['title']['en'] = 'title updated'
        status, updated_data = metax.update_dataset(dataset['id'], dataset)
        self.assertIn(status, self.OK, "Metax update failure")
        urn = updated_data["identifier"]
        etsin_status, etsin_data = etsin.view_dataset(urn)
        self.assertIn(etsin_status, self.OK, "Etsin failure")
Example #5
0
    def test_create_dataset(self):
        # loading the example dataset

        data = load_json_file('basic_dataset.json')
        status, cdata = metax.create_dataset(data)

        self.assertIn(status, self.OK, "could not create dataset")
        urn = cdata["identifier"]
        time.sleep(10)

        etsin_status, etsin_data = etsin.view_dataset(urn)
        self.assertIn(etsin_status, self.OK, "Etsin could not found the dataset")
Example #6
0
    def test_delete_dataset(self):
        data = load_json_file('basic_dataset.json')

        status, cdata = metax.create_dataset(data)
        self.assertIn(status, self.OK, "could not create dataset")
        urn = cdata["identifier"]

        time.sleep(2)
        status = metax.delete_dataset(cdata['id'])
        self.assertIn(status, self.OK, "Metax dataset delete failure")

        etsin_status, etsin_data = etsin.view_dataset(urn)
        self.assertIn(etsin_status, self.FAIL, "Etsin found the deleted dataset")
Example #7
0
    def test_delete_dataset(self):
        data = get_minimal_dataset_template()

        status, response = metax.create_dataset(data)
        self.assertIn(status, self.OK,
                      "could not create dataset: " + str(response))
        cdata = response.json()
        urn = cdata["identifier"]

        time.sleep(2)
        status, response = metax.delete_dataset(cdata['id'])
        self.assertIn(status, self.OK,
                      "Metax dataset delete failure: " + str(response))

        etsin_status, etsin_data = etsin.view_dataset(urn)