From d0323ef38983985620f50f5ab36e2cb9e9041203 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Thu, 2 Jun 2016 11:35:03 -0400 Subject: [PATCH] popcorn: test test_example_static_default with pop_tests Signed-off-by: Alexandre Terrasa --- .../static_files}/test_example_static_default.nit | 34 +++++++------------- .../test_example_static_default.res | 0 2 files changed, 11 insertions(+), 23 deletions(-) rename lib/popcorn/{tests => examples/static_files}/test_example_static_default.nit (72%) rename lib/popcorn/{tests/res => examples/static_files/test_example_static_default.sav}/test_example_static_default.res (100%) diff --git a/lib/popcorn/tests/test_example_static_default.nit b/lib/popcorn/examples/static_files/test_example_static_default.nit similarity index 72% rename from lib/popcorn/tests/test_example_static_default.nit rename to lib/popcorn/examples/static_files/test_example_static_default.nit index ced04e2..af2a068 100644 --- a/lib/popcorn/tests/test_example_static_default.nit +++ b/lib/popcorn/examples/static_files/test_example_static_default.nit @@ -14,39 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -import base_tests +module test_example_static_default is test_suite + +import pop_tests import example_static_default -class TestClient - super ClientThread +class TestExampleStaticDefault + super TestPopcorn - redef fun main do + redef fun client_test do system "curl -s {host}:{port}/css/style.css" system "curl -s {host}:{port}/js/app.js" system "curl -s {host}:{port}/hello.html" system "curl -s {host}:{port}/" - system "curl -s {host}:{port}/css/not_found.nit" system "curl -s {host}:{port}/static/css/not_found.nit" system "curl -s {host}:{port}/not_found.nit" + end - return null + fun test_example_param_route do + var app = new App + app.use("/", new StaticHandler("../examples/static_files/public/", "default.html")) + run_test(app) end end - -var app = new App -app.use("/", new StaticHandler("../examples/static_files/public/", "default.html")) - -var host = test_host -var port = test_port - -var server = new AppThread(host, port, app) -server.start -0.1.sleep - -var client = new TestClient(host, port) -client.start -client.join -0.1.sleep - -exit 0 diff --git a/lib/popcorn/tests/res/test_example_static_default.res b/lib/popcorn/examples/static_files/test_example_static_default.sav/test_example_static_default.res similarity index 100% rename from lib/popcorn/tests/res/test_example_static_default.res rename to lib/popcorn/examples/static_files/test_example_static_default.sav/test_example_static_default.res -- 1.7.9.5