[asterisk-commits] dlee: branch dlee/stasis-http r379264 - /team/dlee/stasis-http/tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 16 12:30:13 CST 2013


Author: dlee
Date: Wed Jan 16 12:30:09 2013
New Revision: 379264

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379264
Log:
Testing 404

Modified:
    team/dlee/stasis-http/tests/test_stasis_http.c

Modified: team/dlee/stasis-http/tests/test_stasis_http.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-http/tests/test_stasis_http.c?view=diff&rev=379264&r1=379263&r2=379264
==============================================================================
--- team/dlee/stasis-http/tests/test_stasis_http.c (original)
+++ team/dlee/stasis-http/tests/test_stasis_http.c Wed Jan 16 12:30:09 2013
@@ -484,6 +484,32 @@
 	return AST_TEST_PASS;
 }
 
+AST_TEST_DEFINE(invoke_not_found)
+{
+	RAII_VAR(void *, fixture, setup_invocation_test(), tear_down_invocation_test);
+	RAII_VAR(struct stasis_http_response *, response, response_alloc(), response_free);
+	struct ast_variable *get_params = NULL;
+	struct ast_variable *headers = NULL;
+
+	switch (cmd) {
+	case TEST_INIT:
+		info->name = __func__;
+		info->category = "/stasis/http/";
+		info->summary = "Test simple GET of an HTTP resource.";
+		info->description = "Test Stasis HTTP binding logic.";
+		return AST_TEST_NOT_RUN;
+	case TEST_EXECUTE:
+		break;
+	}
+
+	stasis_http_invoke("foo/fizzle/i-am-not-a-resource", AST_HTTP_POST, get_params, headers, response);
+
+	ast_test_validate(test, 0 == invocation_count);
+	ast_test_validate(test, 404 == response->response_code);
+
+	return AST_TEST_PASS;
+}
+
 static int unload_module(void)
 {
 	AST_TEST_UNREGISTER(get_api);
@@ -495,6 +521,7 @@
 	AST_TEST_UNREGISTER(invoke_delete);
 	AST_TEST_UNREGISTER(invoke_post);
 	AST_TEST_UNREGISTER(invoke_bad_post);
+	AST_TEST_UNREGISTER(invoke_not_found);
 	return 0;
 }
 
@@ -509,6 +536,7 @@
 	AST_TEST_REGISTER(invoke_delete);
 	AST_TEST_REGISTER(invoke_post);
 	AST_TEST_REGISTER(invoke_bad_post);
+	AST_TEST_REGISTER(invoke_not_found);
 	return AST_MODULE_LOAD_SUCCESS;
 }
 




More information about the asterisk-commits mailing list