コード例 #1
0
    def test_equality(self):
        coordinates = (1.1, 2.2,)

        a = jit.GeometricPosition(coordinates, self.surface)
        b = jit.GeometricPosition(coordinates, self.surface)

        self.assertEqual(a, b)
コード例 #2
0
    def test_as_str(self):
        coordinates = (3, 4,)
        position = jit.GeometricPosition(coordinates, self.surface)

        expected = '(' + ",".join(f"{x:07.3f}" for x in coordinates) + ')'

        self.assertEqual(expected, str(position))
コード例 #3
0
    def test_as_tuple(self):
        coordinates = (3, 4,)
        position = jit.GeometricPosition(coordinates, self.surface)

        expected = (
            ('coordinates', coordinates),
        )
        self.assertEqual(expected, tuple(position))
コード例 #4
0
 def test_construction(self):
     coordinates = (
         3,
         4,
     )
     position = jit.GeometricPosition(coordinates, self.surface)
     self.assertEqual(coordinates[0], position[0])
     self.assertEqual(coordinates[1], position[1])
     self.assertEqual(hash(coordinates), hash(position))
コード例 #5
0
    def test_not_equality(self):
        a = jit.GeometricPosition([1.1, 2.2], self.surface)
        b = jit.GeometricPosition([3.3, 4.4], self.surface)

        self.assertNotEqual(a, b)