def test_way_relation_update_direction_from_starting_node_resets_speed_limit(
            self):
        wayRelation = WayRelation(mockOSMWay_01_01_LongCurvy)
        wayRelation._speed_limit = 10.

        wayRelation.update_direction_from_starting_node(
            wayRelation.way.nodes[0].id)

        self.assertIsNone(wayRelation._speed_limit)
    def test_way_relation_update_direction_from_starting_node_updates_correctly(
            self):
        wayRelation = WayRelation(mockOSMWay_01_01_LongCurvy)
        wayRelation.update_direction_from_starting_node(
            wayRelation.way.nodes[0].id)
        self.assertEqual(wayRelation.direction, DIRECTION.FORWARD)

        wayRelation.update_direction_from_starting_node(
            wayRelation.way.nodes[-1].id)
        self.assertEqual(wayRelation.direction, DIRECTION.BACKWARD)

        wayRelation.update_direction_from_starting_node(0)
        self.assertEqual(wayRelation.direction, DIRECTION.NONE)