Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

import unittest 

 

import astshim as ast 

from astshim.test import MappingTestCase 

 

 

class TestCmpFrame(MappingTestCase): 

 

def test_CmpFrame(self): 

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

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

cmpframe = ast.CmpFrame(frame1, frame2) 

# adding to a CmpFrame increases by 1 

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

# adding to a CmpFrame increases by 1 

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

 

self.assertEqual(cmpframe.nAxes, 3) 

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

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

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

 

self.checkPersistence(cmpframe) 

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

 

 

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

unittest.main()