+ def test_new(self):
+ self.assertEqual(Point({self.x: 10, self.y: 5, self.z: 1}), self.pt1)
+ self.assertEqual(Point([(self.x, 10), (self.y, 5), (self.z, 1)]),
+ self.pt1)
+
+ def test_symbols(self):
+ self.assertTupleEqual(self.pt1.symbols, (self.x, self.y, self.z))
+
+ def test_dimension(self):
+ self.assertEqual(self.pt1.dimension, 3)
+
+ def test_coordinate(self):
+ self.assertEqual(self.pt1.coordinate(self.x), 10)
+ with self.assertRaises(KeyError):
+ self.pt1.coordinate(self.t)
+
+ def test_getitem(self):
+ self.assertEqual(self.pt1[self.x], 10)
+ with self.assertRaises(KeyError):
+ self.pt1[self.t]
+
+ def test_coordinates(self):
+ self.assertListEqual(list(self.pt1.coordinates()),
+ [(self.x, 10), (self.y, 5), (self.z, 1)])
+
+ def test_values(self):
+ self.assertListEqual(list(self.pt1.values()),
+ [10, 5, 1])
+
+ def test_isorigin(self):
+ self.assertFalse(self.pt1.isorigin())
+ self.assertTrue(Point({}).isorigin())
+
+ def test_bool(self):
+ self.assertTrue(self.pt1)
+ self.assertFalse(Point({}))
+