summaryrefslogtreecommitdiff
path: root/tests/it_url.t
diff options
context:
space:
mode:
authorNathan Gass2012-10-15 16:57:11 +0000
committerNathan Gass2012-10-15 16:57:11 +0000
commitec2b0d1c3ad2b285adeea8bbb7e40878d82b4f98 (patch)
treea376518c16d22b43641a820cc3d8a2116a21227c /tests/it_url.t
parent87587774e477cdeb9b1dd3580ebb55d86db182e8 (diff)
downloaditools-ec2b0d1c3ad2b285adeea8bbb7e40878d82b4f98.tar.gz
itools-ec2b0d1c3ad2b285adeea8bbb7e40878d82b4f98.tar.bz2
itools-ec2b0d1c3ad2b285adeea8bbb7e40878d82b4f98.zip
add more it_url::get tests (some todo)
Diffstat (limited to 'tests/it_url.t')
-rwxr-xr-xtests/it_url.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/it_url.t b/tests/it_url.t
index 0655bda..e5f5c6b 100755
--- a/tests/it_url.t
+++ b/tests/it_url.t
@@ -164,6 +164,37 @@ $output = server_output();
if (!$res)
diag($output);
+$res = is(
+ it_url::get('http://localhost:8000/relative_redirect'),
+ "Testserver output after relative redirect",
+ 'TODO: it_url::get() follows relative redirect correctly',
+);
+$output = server_output();
+if (!$res)
+ diag($output);
+
+$res = is(
+ it_url::get('http://localhost:8000/nohost_redirect'),
+ "Testserver output after nohost redirect",
+ 'TODO: it_url::get() follows redirect without host correctly',
+);
+$output = server_output();
+if (!$res)
+ diag($output);
+
+
+$res = ok(
+ !it_url::get('url' => 'http://localhost:8000/does_not_exist', 'retries' => 4),
+ 'it_url::get() retries on empty response',
+);
+$output = server_output();
+$res2 = ok(
+ count(preg_grep('/^Got Request:/', $output)) == 5,
+ 'it_url::get() respects set retry count',
+);
+if (!$res || !$res2)
+ diag($output);
+
$res = ok(
!it_url::get(U('http://localhost:8000/redirect_loop', 'num' => 10)),
'it_url::get() handles redirect loop',