def METHOD_NAME(
    self, con100, tmp_path, requests_mock, target, expected_target
):
    source = tmp_path / "to-upload.txt"
    source.write_bytes(b"hello world\n")
    def put_files(request, context):
        import io
        if isinstance(request.text, io.BufferedReader):
            body = request.text.read()
        else:
            body = request.text
        assert body == b"hello world\n"
        context.status_code = 200
        return {
            "path": re.match("/files/(.*)", request.path).group(1),
            "size": len(body),
            "modified": "2018-01-03T10:55:29Z",
        }
    upload_mock = requests_mock.put(
        API_URL + f"/files/{expected_target}", json=put_files
    )
    f = con100.upload_file(source, target=target)
    assert upload_mock.call_count == 1
    assert f.path == PurePosixPath(expected_target)
    assert f.metadata == {
        "path": expected_target,
        "size": 12,
        "modified": "2018-01-03T10:55:29Z",
    }