From 0093b6d71970eade8424c9d942f5c35921ee883a Mon Sep 17 00:00:00 2001 From: arcangelo7 Date: Mon, 29 Jan 2024 21:23:35 +0100 Subject: [PATCH] tests fix --- tests/test_statistics.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/tests/test_statistics.py b/tests/test_statistics.py index 7b25104..b60f2ea 100644 --- a/tests/test_statistics.py +++ b/tests/test_statistics.py @@ -22,6 +22,26 @@ import unittest CONFIG_PATH = os.path.join('tests', 'config.json') +CONFIG = { + "dataset": { + "triplestore_urls": ["http://127.0.0.1:9999/blazegraph/sparql"], + "file_paths": [], + "is_quadstore": True + }, + "provenance": { + "triplestore_urls": [], + "file_paths": ["tests/prov.json"], + "is_quadstore": True + }, + "blazegraph_full_text_search": "no", + "fuseki_full_text_search": "no", + "virtuoso_full_text_search": "no", + "graphdb_connector_name": "", + "cache_triplestore_url": { + "endpoint": "", + "update_endpoint": "" + } +} CONFIG_BLAZEGRAPH = os.path.join('tests', 'config_blazegraph.json') class Test_Statistics(unittest.TestCase): @@ -60,7 +80,7 @@ def test_statistics_sv(self): self.assertEqual(overhead, expected_output) def test_statistics_ma_all(self): - agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config_path=CONFIG_PATH) + agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config=CONFIG) entity_history, _ = agnostic_entity.get_history() statistics = Statistics(entity_history) overhead = statistics.get_overhead() @@ -68,7 +88,7 @@ def test_statistics_ma_all(self): self.assertEqual(overhead, expected_output) def test_statistics_ma_single(self): - agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config_path=CONFIG_PATH) + agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config=CONFIG) _, entity_snapshots, other_snapshots = agnostic_entity.get_state_at_time(time=('2021-05-07T09:59:15', '2021-05-07T09:59:15'), include_prov_metadata=True) statistics = Statistics((entity_snapshots, other_snapshots)) overhead = statistics.get_overhead() @@ -76,7 +96,7 @@ def test_statistics_ma_single(self): self.assertEqual(overhead, expected_output) def test_statistics_ma_single_zero(self): - agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config_path=CONFIG_PATH) + agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config=CONFIG) _, entity_snapshots, other_snapshots = agnostic_entity.get_state_at_time(time=('2022-05-07T09:59:15', '2022-05-07T09:59:15'), include_prov_metadata=True) statistics = Statistics((entity_snapshots, other_snapshots)) overhead = statistics.get_overhead() @@ -84,7 +104,7 @@ def test_statistics_ma_single_zero(self): self.assertEqual(overhead, expected_output) def test_statistics_ma_single_2(self): - agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config_path=CONFIG_PATH) + agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config=CONFIG) _, entity_snapshots, other_snapshots = agnostic_entity.get_state_at_time(time=('2021-05-31T18:19:47', '2021-05-31T18:19:47'), include_prov_metadata=True) statistics = Statistics((entity_snapshots, other_snapshots)) overhead = statistics.get_overhead() @@ -92,7 +112,7 @@ def test_statistics_ma_single_2(self): self.assertEqual(overhead, expected_output) def test_statistics_ma_single_1(self): - agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config_path=CONFIG_PATH) + agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config=CONFIG) _, entity_snapshots, other_snapshots = agnostic_entity.get_state_at_time(time=('2021-06-01T18:46:41', '2021-06-01T18:46:41'), include_prov_metadata=True) statistics = Statistics((entity_snapshots, other_snapshots)) overhead = statistics.get_overhead() @@ -100,7 +120,7 @@ def test_statistics_ma_single_1(self): self.assertEqual(overhead, expected_output) def test_statistics_ma_single_interval(self): - agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config_path=CONFIG_PATH) + agnostic_entity = AgnosticEntity('https://github.com/arcangelo7/time_agnostic/ar/15519', config=CONFIG) _, entity_snapshots, other_snapshots = agnostic_entity.get_state_at_time(time=('2021-05-31T18:19:47', '2021-06-01T18:46:41'), include_prov_metadata=True) statistics = Statistics((entity_snapshots, other_snapshots)) overhead = statistics.get_overhead()