summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-12-04 11:23:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-12-04 11:23:18 +0000
commit6eef7bc0b00f1e76542cc9ce86c0fd66b1e3f567 (patch)
treee9b1d971bc5214c5d83f1547ea8b01a58f9276c1 /t
parentadbe3c472ddd97339e2afda60d0a61c069489236 (diff)
downloadurpmi-6eef7bc0b00f1e76542cc9ce86c0fd66b1e3f567.tar
urpmi-6eef7bc0b00f1e76542cc9ce86c0fd66b1e3f567.tar.gz
urpmi-6eef7bc0b00f1e76542cc9ce86c0fd66b1e3f567.tar.bz2
urpmi-6eef7bc0b00f1e76542cc9ce86c0fd66b1e3f567.tar.xz
urpmi-6eef7bc0b00f1e76542cc9ce86c0fd66b1e3f567.zip
add tests for --probe-synthesis/--probe-hdlist
Diffstat (limited to 't')
-rw-r--r--t/superuser--addmedia.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/superuser--addmedia.t b/t/superuser--addmedia.t
new file mode 100644
index 00000000..d8e31ad3
--- /dev/null
+++ b/t/superuser--addmedia.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+use strict;
+use lib '.', 't';
+use helper;
+use Test::More 'no_plan';
+BEGIN { use_ok 'urpm::cfg' }
+
+need_root_and_prepare();
+
+my $name = 'various';
+
+try('', { hdlist => undef, synthesis => undef });
+try('--probe-hdlist', { hdlist => "hdlist.$name.cz", synthesis => undef });
+try('--probe-synthesis', { hdlist => undef, synthesis => 1 });
+
+sub try {
+ my ($options, $want) = @_;
+ urpmi_addmedia("$name $::pwd/media/$name $options");
+ my $config = urpm::cfg::load_config("root/etc/urpmi/urpmi.cfg");
+ my ($medium) = @{$config->{media}};
+ ok($medium);
+ foreach my $field (keys %$want) {
+ is($medium->{$field}, $want->{$field});
+ }
+ urpmi_removemedia($name);
+}