diff options
author | Michael McVady <femtonaut@gmail.com> | 2023-02-19 11:57:08 -0600 |
---|---|---|
committer | Michael McVady <femtonaut@gmail.com> | 2023-02-19 11:57:08 -0600 |
commit | 011e8d8870a6c14674e5e389bfdc09dae62b948d (patch) | |
tree | 44d3fcd211ad2348326c2b78b66c20d9d7add948 | |
parent | 9092c94ee231e99dc31b1b265179866a404614e4 (diff) |
Clean up
-rwxr-xr-x | run-local.sh | 8 | ||||
-rw-r--r-- | src/clog.c | 6 | ||||
-rw-r--r-- | src/init.c | 7 | ||||
-rwxr-xr-x | tests.py | 4 |
4 files changed, 13 insertions, 12 deletions
diff --git a/run-local.sh b/run-local.sh new file mode 100755 index 0000000..458de5d --- /dev/null +++ b/run-local.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +set -a +. ./.env +set +a + +make +make run @@ -521,11 +521,7 @@ int sql_render_posts(struct kore_pgsql *sql, struct post_query *pq) { } int -sql_insert_posts( - const char *id, - const char *title, - const char *body -) { +sql_insert_posts(const char *id, const char *title, const char *body) { int err = KORE_RESULT_OK; struct kore_pgsql sql; @@ -69,11 +69,8 @@ init_db(void) { // Register the database pg_config = kore_buf_stringify(pg_config_buf, NULL); - kore_log(LOG_INFO, "%s", pg_config); - err = kore_pgsql_register( - database, - pg_config - ); + // kore_log(LOG_DEBUG, "%s", pg_config); + err = kore_pgsql_register(database, pg_config); kore_buf_free(pg_config_buf); @@ -18,6 +18,7 @@ JSON_ACCEPT_HEADER = {"Accept": "application/json"} log = logging.getLogger(__name__) log.setLevel(logging.INFO) + def test_redirect(): url = f"{BASE_URL}/asdf" r = requests.get(url, allow_redirects=False) @@ -100,8 +101,7 @@ def test_json_get_posts(): def test_json_post_posts(): url = f"{BASE_URL}/posts" - uuid_ = str(uuid.uuid4()) - data = {"id": uuid_, "title": "title", "body": "body"} + data = {"id": str(uuid.uuid4()), "title": "title", "body": "body"} r = requests.post(url, headers=JSON_ACCEPT_HEADER, json=data) assert r.status_code == 201 j = r.json() |