def test_fromCartesian(self): """MageList fromCartesian() should return new list with ACG coordinates """ point = MagePoint([.1,.2,.3]) m = MageList([point]*5,Color='green') res = m.toCartesian().fromCartesian() self.assertEqual(str(m),str(res))
def test_toCartesian(self): """MageList toCartesian should return new list""" m = MageList([self.null],Color='green') res = m.toCartesian() self.assertEqual(len(m), len(res)) self.assertEqual(m.Color,res.Color) self.assertEqual(res[0].Coordinates,[1,1,1]) m.Color='red' self.assertEqual(res.Color,'green') m = MageList([self.properties]) self.assertRaises(ValueError,m.toCartesian)