示例#1
0
 def test_del_state(self):
     "Atom: delete state"
     Fe57 = Atom('Fe', mass=57)
     Fe57.velocity = (0, 0, 1)
     del Fe57.velocity
     self._assertRaises(AttributeError, 'Fe57.velocity', locals())
     return
示例#2
0
 def test_del_state(self):
     "Atom: delete state"
     Fe57 = Atom( 'Fe', mass=57 )
     Fe57.velocity = (0,0,1)
     del Fe57.velocity
     self._assertRaises( AttributeError, 'Fe57.velocity', locals())
     return
示例#3
0
 def test_setable_state(self):
     "Atom: setable state"
     Fe57 = Atom('Fe', mass=57)
     v = (0, 0, 1)
     print '- Set velocity to %s ... ' % (v, ),
     Fe57.velocity = v
     print ' velocity = %s ' % (Fe57.velocity, )
     print "- velocity's documentation: %s " % Atom.velocity.doc
     return
示例#4
0
 def test_setable_state(self):
     "Atom: setable state"
     Fe57 = Atom( 'Fe', mass=57 )
     v = (0,0,1)
     print '- Set velocity to %s ... ' % (v,), 
     Fe57.velocity = v
     print ' velocity = %s ' % (Fe57.velocity,)
     print "- velocity's documentation: %s " % Atom.velocity.doc
     return
示例#5
0
 def test_str(self):
     "Atom: __str__"
     Fe57 = Atom('Fe', mass=57)
     Fe57.velocity = (0, 0, 1)
     print Fe57
     return
示例#6
0
 def test_str(self):
     "Atom: __str__"
     Fe57 = Atom( 'Fe', mass=57 )
     Fe57.velocity = (0,0,1)
     print Fe57
     return