From 1bbaeacc8466ae4dc50d9513348fdef994118fbe Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Thu, 19 Nov 2020 13:37:26 +0100 Subject: [PATCH] Add simple test for conf.d --- emgauwa-core.conf.d/conf_d_working.conf | 3 +++ tests/emgauwa-core-testing.conf | 3 +-- tests/emgauwa-core-testing.conf.d/conf_d_working.conf | 3 +++ tests/tavern_tests/0.1.test_basics.tavern.yaml | 9 +++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 emgauwa-core.conf.d/conf_d_working.conf create mode 100644 tests/emgauwa-core-testing.conf.d/conf_d_working.conf diff --git a/emgauwa-core.conf.d/conf_d_working.conf b/emgauwa-core.conf.d/conf_d_working.conf new file mode 100644 index 0000000..dc4616a --- /dev/null +++ b/emgauwa-core.conf.d/conf_d_working.conf @@ -0,0 +1,3 @@ +[core] +not-found-content = "CONF.D WORKING" +not-found-content-type = "text/plain" diff --git a/tests/emgauwa-core-testing.conf b/tests/emgauwa-core-testing.conf index f475720..c3896b2 100644 --- a/tests/emgauwa-core-testing.conf +++ b/tests/emgauwa-core-testing.conf @@ -1,10 +1,9 @@ [core] database = "emgauwa-core.sqlite" +include = "../emgauwa-core-testing.conf.d" content-dir = "." not-found-file = "404.html" not-found-file-mime = "text/html" -not-found-content = "404 - NOT FOUND" -not-found-content-type = "text/plain" [ports] server = 5000 diff --git a/tests/emgauwa-core-testing.conf.d/conf_d_working.conf b/tests/emgauwa-core-testing.conf.d/conf_d_working.conf new file mode 100644 index 0000000..ac1dfee --- /dev/null +++ b/tests/emgauwa-core-testing.conf.d/conf_d_working.conf @@ -0,0 +1,3 @@ +[core] +not-found-content = '{"msg": "conf.d working"}' +not-found-content-type = "application/json" diff --git a/tests/tavern_tests/0.1.test_basics.tavern.yaml b/tests/tavern_tests/0.1.test_basics.tavern.yaml index 14ac8b5..8eff061 100644 --- a/tests/tavern_tests/0.1.test_basics.tavern.yaml +++ b/tests/tavern_tests/0.1.test_basics.tavern.yaml @@ -14,3 +14,12 @@ stages: method: GET response: status_code: 404 + +- name: "[test_basics] verify conf.d by 404" + request: + url: "http://localhost:5000/invalid_url_for_testing_do_not_use" + method: GET + response: + status_code: 404 + json: + msg: "conf.d working"