def test_basic(circle_events_pair: BoundPortedCircleEventsPair,
               first_sites_pair: BoundPortedSiteEventsPair,
               second_sites_pair: BoundPortedSiteEventsPair,
               third_sites_pair: BoundPortedSiteEventsPair,
               segment_index: int,
               recompute_center_x: bool,
               recompute_center_y: bool,
               recompute_lower_x: bool) -> None:
    bound_circle_event, ported_circle_event = circle_events_pair
    first_site_bound, first_site_ported = first_sites_pair
    second_site_bound, second_site_ported = second_sites_pair
    third_site_bound, third_site_ported = third_sites_pair

    try:
        bound(bound_circle_event, first_site_bound, second_site_bound,
              third_site_bound, segment_index, recompute_center_x,
              recompute_center_y, recompute_lower_x)
    except ValueError:
        with pytest.raises(ValueError):
            ported(ported_circle_event, first_site_ported, second_site_ported,
                   third_site_ported, segment_index, recompute_center_x,
                   recompute_center_y, recompute_lower_x)
    else:
        ported(ported_circle_event, first_site_ported, second_site_ported,
               third_site_ported, segment_index, recompute_center_x,
               recompute_center_y, recompute_lower_x)

        assert are_bound_ported_circle_events_equal(bound_circle_event,
                                                    ported_circle_event)
コード例 #2
0
def test_basic(center_x: float,
               center_y: float,
               lower_x: float,
               is_active: bool) -> None:
    bound, ported = (BoundCircleEvent(center_x, center_y, lower_x, is_active),
                     PortedCircleEvent(center_x, center_y, lower_x, is_active))

    assert are_bound_ported_circle_events_equal(bound, ported)
def test_basic(circle_events_pair: BoundPortedCircleEventsPair,
               first_sites_pair: BoundPortedSiteEventsPair,
               second_sites_pair: BoundPortedSiteEventsPair,
               third_sites_pair: BoundPortedSiteEventsPair) -> None:
    bound_circle_event, ported_circle_event = circle_events_pair
    bound_first_site, ported_first_site = first_sites_pair
    bound_second_site, ported_second_site = second_sites_pair
    bound_third_site, ported_third_site = third_sites_pair

    try:
        bound(bound_circle_event, bound_first_site, bound_second_site,
              bound_third_site)
    except ValueError:
        with pytest.raises(ValueError):
            ported(ported_circle_event, ported_first_site, ported_second_site,
                   ported_third_site)
    else:
        ported(ported_circle_event, ported_first_site, ported_second_site,
               ported_third_site)

        assert are_bound_ported_circle_events_equal(bound_circle_event,
                                                    ported_circle_event)