Coverage for skema/program_analysis/CAST/matlab/tests/test_file_ingest.py: 92%

12 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-30 17:15 +0000

1import os.path 

2from skema.program_analysis.CAST.matlab.matlab_to_cast import MatlabToCast 

3from skema.program_analysis.CAST.matlab.tests.utils import (check, cast) 

4from skema.program_analysis.CAST2FN.model.cast import Assignment 

5 

6def test_file_ingest(): 

7 """ Test the ability of the CAST translator to read from a file""" 

8 

9 filepath = "skema/program_analysis/CAST/matlab/tests/data/matlab.m" 

10 if not os.path.exists(filepath): 

11 filepath = "data/matlab.m" 

12 

13 

14 

15 cast = MatlabToCast(source_path = filepath).out_cast 

16 module = cast.nodes[0] 

17 nodes = module.body 

18 check(nodes[0], Assignment(left = "y", right = "b"))