WIP: api testing

Jef Roosens 2022-06-15 12:21:14 +02:00
parent 2fea78a6f8
commit 2a4f0654ea
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
3 changed files with 19 additions and 1 deletions

View File

@ -12,7 +12,7 @@ pub fn (c &Client) get_targets(filter TargetFilter) ?[]Target {
return data.data
}
// get_all_targets retrieves *all* targs from the API using the default
// get_all_targets retrieves *all* targets from the API using the default
// limit.
pub fn (c &Client) get_all_targets() ?[]Target {
mut targets := []Target{}

View File

@ -1,4 +1,5 @@
// Bindings for the libarchive library
module package
#flag -larchive

View File

@ -0,0 +1,17 @@
module server
import io.util
import os
fn test_targets_api() ? {
// Create a database
// Start the server in a temporary directory
tmpdir := util.temp_dir()?
go server.server(
data_dir: tmpdir
pkg_dir: os.join_path_single(tmpdir, 'pkgs')
api_key: 't'
port: 9000
)
}