Coverage for test/endgame_test.py: 58%

12 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2025-07-14 14:06 +0000

1#!python 

2# Copyright 2023, Arcangelo Massari <arcangelo.massari@unibo.it> 

3# 

4# Permission to use, copy, modify, and/or distribute this software for any purpose 

5# with or without fee is hereby granted, provided that the above copyright notice 

6# and this permission notice appear in all copies. 

7# 

8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 

9# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 

10# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, 

11# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 

12# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

13# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 

14# SOFTWARE. 

15 

16import os 

17import unittest 

18from SPARQLWrapper import POST, SPARQLWrapper 

19 

20 

21BASE_DIR = os.path.join('test', 'endgame') 

22SERVER = 'http://127.0.0.1:8805/sparql' 

23 

24def reset_server(server:str=SERVER) -> None: 

25 ts = SPARQLWrapper(server) 

26 ts.setQuery('DELETE WHERE { GRAPH ?g { ?s ?p ?o } }') 

27 ts.setMethod(POST) 

28 ts.query() 

29 

30# class test_Endgame(unittest.TestCase): 

31# def test_endgame(self): 

32# reset_server() 

33# # {'csv': {'ra': 9403, 'br': 10472, 're': 0, 'id': 0, 'ar': 0}, 'rdf': {'ra': 133479, 'br': 32669, 're': 21937, 'id': 58722, 'ar': 157990}, 'triplestore': {'ra': 133479, 'br': 32669, 're': 21937, 'ar': 157990, 'id': 58722}} 

34# meta_config_path = os.path.join(BASE_DIR, 'endgame.yaml') 

35# with open(meta_config_path, encoding='utf-8') as file: 

36# settings = yaml.full_load(file) 

37# # python_executable = "python" if platform == "win32" else "python3" 

38# # prepare_command = ["poetry", "run", python_executable, "-m", "oc_meta.run.prepare_multiprocess", "-c", meta_config_path] 

39# # result = subprocess.run(prepare_command, shell=True, check=True) 

40# # if result.returncode == 0: 

41# run_meta_process(settings=settings, meta_config_path=meta_config_path) 

42# # else: 

43# # raise Exception("prepare_multiprocess failed") 

44 

45if __name__ == '__main__': 

46 unittest.main()