예제 #1
0
    def test_pir_to_xy_APIequalsALLENSDK(self, dataset_id, p, i, r):
        """Test that manually extracted requests equals official Allen's package result.

        Notes
        -----
        The official package is called AllenSDK, see https://github.com/AllenInstitute/AllenSDK.

        """

        x, y, section_number, closest_section_image_id = pir_to_xy_API_single(
            p, i, r, dataset_id=dataset_id
        )

        sync_api = SynchronizationApi()
        r = sync_api.get_reference_to_image(9, p, i, r, [dataset_id])[0]["image_sync"]

        x_s, y_s, section_number_s, closest_section_image_id_s = (
            r["x"],
            r["y"],
            r["section_number"],
            r["section_image_id"],
        )

        assert x == x_s
        assert y == y_s
        assert section_number == section_number_s
        assert closest_section_image_id == closest_section_image_id_s
def synch():
    sa = SynchronizationApi()
    sa.json_msg_query = MagicMock(name='json_msg_query')

    return sa