Exemplo n.º 1
0
    def testeqShape(self):

        space1 = PSpace('adc', n1=12, n2=12)
        space2 = space1.copy()
        space3 = space1.copy()

        cf.eqShape(None, [space1, space2, space3])

        del space3['n2']

        self.failUnlessRaises(TypeError, cf.eqType, None,
                              [space1, space2, space3])

        space1 = PSpace('adc', n1=12, n2=1)
        space2 = space1.copy()

        del space2['n2']

        cf.eqShape(None, [space1, space2])
Exemplo n.º 2
0
 def testcopy_eq( self ):
     
     space = PSpace('adc', n1=10, n2=10, data_type='float' )
     
     space_copy = space.copy()
     
     self.failUnlessEqual( space, space_copy )
     # test eq
     self.failUnlessEqual( space.plugin, space_copy.plugin )
     self.failUnlessEqual( space['n1'], space_copy['n1'] )
     self.failUnlessEqual( space['n2'], space_copy['n2'] )
     self.failUnlessEqual( space['data_type'], space_copy['data_type'] )
     
     self.failIfEqual( id(space), id(space_copy) )
Exemplo n.º 3
0
    def testeqType(self):

        space1 = PSpace('adc', data_type='complex')
        space2 = space1.copy()
        space3 = space1.copy()

        cf.eqType(None, [space1, space2, space3])

        space3['data_type'] = 'float'

        self.failUnlessRaises(TypeError, cf.eqType, None,
                              [space1, space2, space3])

        space1 = PSpace('adc')
        self.failUnlessRaises(TypeError, cf.eqType, None, [space1])