예제 #1
0
    def create(
        self,
        image: BinaryIO,
        source: str,
        facesize: Union[int, object] = sentinel,
        create_on_ha: Union[bool, object] = sentinel,
        create_on_junk: Union[bool, object] = sentinel,
        identify_asm: Union[bool, object] = sentinel,
    ) -> Response:
        data = request_form_processing(locals(), ["self", "image"])
        files = {"image": image}

        with self.get_client() as client:
            return client.post(url="/v1/persons/", data=data, files=files)
예제 #2
0
    async def reinit_by_photo(
        self,
        pid: str,
        image: BinaryIO,
        source: str,
        facesize: Union[int, object] = sentinel,
        identify_asm: Union[bool, object] = sentinel,
        result: str = EntryResult.HA,
    ) -> Response:
        data = request_form_processing(locals(), ["self", "image", "pid"])
        files = {"image": image}

        async with self.get_client() as client:
            return await client.post(url=f"/v1/persons/reinit/{pid}/",
                                     data=data,
                                     files=files)
예제 #3
0
def test_request_form_processing_has_exclude():
    data = {"one": 1, "two": sentinel, "self": 3, "three": "3"}

    result = request_form_processing(data, ["three"])
    assert result == {"one": "1"}