Beispiel #1
0
 def test_get_unsynced_dataset_graph_uris(self):
     graph_list = tasks.get_out_of_sync_dataset_record_graph_uris(
         self.dataset_graph_uri,
         self.store
     )
     assert len(graph_list) == 1  # only one graph should be found
     self.assertNotIn(
         "http://localhost:8000/resource/dataset/ton-smits-huis/skos",
         graph_list
     )
Beispiel #2
0
 def test_synchronise_record(self):
     ds = DataSet.get_dataset_from_graph(
         dataset_graph_uri=self.dataset_graph_uri,
         store=self.store
     )
     graph_list = tasks.get_out_of_sync_dataset_record_graph_uris(
         self.dataset_graph_uri,
         self.store
     )
     es_actions = []
     edm_record, es_action = tasks.synchronise_record(
         graph_uri=graph_list[0],
         ds=ds,
         store=self.store,
         es_actions=es_actions
     )
     self.assertIsNotNone(edm_record)
     self.assertIsNotNone(es_action)
     self.assertEqual(
         EDMRecord.objects.count(),
         1,
         "Only one record should be saved"
     )
     self.assertEquals(
         edm_record.dataset,
         ds
     )
     self.assertTrue(
         edm_record.hub_id.endswith("ton-smits-huis_454"),
     )
     self.assertRegex(
         edm_record.hub_id,
         "(.*?)_(.*?)_(.*?)"
     )
     assert edm_record.document_uri == 'http://localhost:8000/resource/aggregation/ton-smits-huis/454'
     self.assertEquals(
         edm_record.named_graph,
         URIRef('http://localhost:8000/resource/aggregation/ton-smits-huis/454/graph')
     )