Пример #1
0
 def testAccess(self):
     v=Dimension(1,0,-1,0,0,0,0)
     self.assertEqual(v[2],-1)
     v[0]=-3
     self.assertEqual(v,Dimension(-3,0,-1,0,0,0,0))
Пример #2
0
 def testCompare(self):
     v=Dimension(1,0,-1,0,0,0,0)
     self.assertEqual(v,Dimension(1,0,-1,0,0,0,0))
     self.assertEqual(v==None,False)
Пример #3
0
 def testCompareMixed(self):
     v = Dimension("m s^-1")
     self.assertEqual(v, Dimension("m s^-1"))
     self.assertEqual(v == None, False)
Пример #4
0
 def testString(self):
     v=Dimension(1,0,-1,0,0,0,0)
     self.assertEqual(str(v),'[ 1 0 -1 0 0 0 0 ]')
Пример #5
0
 def testStringSymbolic(self):
     v = Dimension("m s^-1")
     self.assertEqual(str(v), '[ m s^-1 ]')