python: Fix build issues when using "make build_cached"
[omd.git] / t / 02-test_utils.t
blob75fa334343d2a9708a7a2939b48581759c877dad
1 #!/usr/bin/env perl
3 use warnings;
4 use strict;
5 use Test::More;
7 BEGIN {
8 use lib('t');
9 require TestUtils;
10 import TestUtils;
11 use FindBin;
12 use lib "$FindBin::Bin/lib/lib/perl5";
15 plan( tests => 13 );
17 is(TestUtils::_get_url('http://localhost', '/test/'), 'http://localhost/test/');
18 is(TestUtils::_get_url('http://localhost', 'test/'), 'http://localhost/test/');
19 is(TestUtils::_get_url('http://localhost/test1/', 'test2/'), 'http://localhost/test1/test2/');
20 is(TestUtils::_get_url('http://localhost/test1/index.html', 'test2/'), 'http://localhost/test1/test2/');
21 is(TestUtils::_get_url('http://localhost/index.html', 'test.html'), 'http://localhost/test.html');
22 is(TestUtils::_get_url('http://localhost/index.html', 'http://blah'), 'http://blah');
23 is(TestUtils::_get_url('http://localhost:3000/1.html', 'http://blah'), 'http://blah');
24 is(TestUtils::_get_url('http://localhost:3000/1.html', '/test'), 'http://localhost:3000/test');
25 is(TestUtils::_get_url('http://localhost:3000/1/2.html', '/test'), 'http://localhost:3000/test');
26 is(TestUtils::_get_url('http://localhost:3000/1/2.html', '3.html'), 'http://localhost:3000/1/3.html');
27 is(TestUtils::_get_url('http://localhost:3000/1/2.html?blah', '3.html'), 'http://localhost:3000/1/3.html');
29 isnt(TestUtils::config('BUILD_PACKAGES'), undef);
30 ok(length(TestUtils::config('BUILD_PACKAGES')) > 20, "got string from config: length ".length(TestUtils::config('BUILD_PACKAGES')));