Coverage for tests/test_cmpFrame.py: 35%

18 statements  

« prev     ^ index     » next       coverage.py v7.2.3, created at 2023-04-19 10:51 +0000

1import unittest 

2 

3import astshim as ast 

4from astshim.test import MappingTestCase 

5 

6 

7class TestCmpFrame(MappingTestCase): 

8 

9 def test_CmpFrame(self): 

10 frame1 = ast.Frame(2, "label(1)=a, label(2)=b") 

11 frame2 = ast.Frame(1, "label(1)=c") 

12 cmpframe = ast.CmpFrame(frame1, frame2) 

13 # adding to a CmpFrame increases by 1 

14 self.assertEqual(frame1.getRefCount(), 2) 

15 # adding to a CmpFrame increases by 1 

16 self.assertEqual(frame2.getRefCount(), 2) 

17 

18 self.assertEqual(cmpframe.nAxes, 3) 

19 self.assertEqual(cmpframe.getLabel(1), "a") 

20 self.assertEqual(cmpframe.getLabel(2), "b") 

21 self.assertEqual(cmpframe.getLabel(3), "c") 

22 

23 self.checkPersistence(cmpframe) 

24 self.checkMemoryForCompoundObject(frame1, frame2, cmpframe, isSeries=None) 

25 

26 

27if __name__ == "__main__": 27 ↛ 28line 27 didn't jump to line 28, because the condition on line 27 was never true

28 unittest.main()