Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2700055
basejobtest.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
basejobtest.cpp
View Options
/*
* This file is part of libkazv.
* SPDX-FileCopyrightText: 2020 Tusooa Zhu
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include
<libkazv-config.hpp>
#include
<catch2/catch_all.hpp>
#include
<iostream>
#include
<future>
#include
<basejob.hpp>
#include
<cprjobhandler.hpp>
#include
"tests.hpp"
using
namespace
Kazv
;
TEST_CASE
(
"Base job should fetch correctly"
,
"[basejob][needs-internet]"
)
{
boost
::
asio
::
io_context
ioContext
;
BaseJob
job
(
TEST_SERVER_URL
,
"/.well-known/matrix/client"
,
BaseJob
::
Get
{},
"TestJob"
);
CprJobHandler
h
(
ioContext
.
get_executor
());
h
.
submit
(
job
.
withData
(
json
{{
"test"
,
"bar"
}}),
[
&
h
](
auto
r
)
{
if
(
r
.
statusCode
==
200
)
{
REQUIRE
(
isBodyJson
(
r
.
body
)
);
json
j
=
r
.
jsonBody
().
get
();
REQUIRE_NOTHROW
(
(
j
[
"m.homeserver"
][
"base_url"
])
);
REQUIRE
(
(
j
[
"m.homeserver"
][
"base_url"
].
size
()
>
0
)
);
REQUIRE
(
r
.
dataStr
(
"test"
)
==
"bar"
);
}
h
.
stop
();
});
ioContext
.
run
();
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Fri, Jul 18, 12:12 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
243775
Default Alt Text
basejobtest.cpp (1 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment