Пример #1
0
    def test_compare_points_equal(self):
        # given
        point = Point(uid=None,
                      coordinates=(10.0, 0.0, 2.0),
                      data=create_data_container())
        reference = Point(uid=None,
                          coordinates=(10.0, 0.0, 2.0),
                          data=create_data_container())

        # this should pass without problems
        compare_points(point, reference, testcase=self)
Пример #2
0
    def test_compare_points_equal(self):
        # given
        point = Point(
            uid=None,
            coordinates=(10.0, 0.0, 2.0),
            data=create_data_container())
        reference = Point(
            uid=None,
            coordinates=(10.0, 0.0, 2.0),
            data=create_data_container())

        # this should pass without problems
        compare_points(point, reference, testcase=self)
Пример #3
0
    def test_compare_points_not_equal(self):
        # given
        point = Point(
            uid=uuid.uuid4(),
            coordinates=(10.0, 0.0, 2.0),
            data=create_data_container())
        reference = Point(
            uid=uuid.uuid4(),
            coordinates=(10.0, 0.0, 2.0),
            data=create_data_container())

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)

        # given
        point = Point(
            uid=reference.uid,
            coordinates=(10.0, 30.0, 2.0),
            data=create_data_container())

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)

        # given
        point = Point(
            uid=reference.uid,
            coordinates=(10.0, 0.0, 2.0),
            data=DataContainer())

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)

        # given
        point = Point((0, 0, 0))

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)
Пример #4
0
    def test_compare_points_not_equal(self):
        # given
        point = Point(uid=uuid.uuid4(),
                      coordinates=(10.0, 0.0, 2.0),
                      data=create_data_container())
        reference = Point(uid=uuid.uuid4(),
                          coordinates=(10.0, 0.0, 2.0),
                          data=create_data_container())

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)

        # given
        point = Point(uid=reference.uid,
                      coordinates=(10.0, 30.0, 2.0),
                      data=create_data_container())

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)

        # given
        point = Point(uid=reference.uid,
                      coordinates=(10.0, 0.0, 2.0),
                      data=DataContainer())

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)

        # given
        point = Point((0, 0, 0))

        # when/then
        with self.assertRaises(AssertionError):
            compare_points(point, reference, testcase=self)