Coverage for test/get_diff_test.py: 100%

13 statements  

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

1#!python 

2# Copyright 2022, Arcangelo Massari <arcangelo.massari@unibo.it>, Arianna Moretti <arianna.moretti4@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 

16 

17import os 

18import unittest 

19 

20from oc_meta.lib.file_manager import get_csv_data 

21from oc_meta.run.get_diff import get_diff 

22 

23BASE = os.path.join('test', 'get_diff') 

24 

25 

26class GetDiffTest(unittest.TestCase): 

27 def test_get_diff(self): 

28 output_file = os.path.join(BASE, 'diff.csv') 

29 get_diff(os.path.join(BASE, 'csv'), os.path.join(BASE, 'new.csv'), output_file) 

30 output = get_csv_data(output_file) 

31 expected_output = [{'id': '10.1093/bioinformatics'}] 

32 os.remove(output_file) 

33 self.assertEqual(output, expected_output)