aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-06-26 20:50:55 +0200
committerAngelo Naselli <anaselli@linux.it>2015-06-26 20:50:55 +0200
commit40afb16ec80e02645b6d87e460e328c74eb23bba (patch)
treefcd190dcb7745b82445771fa6046660a969b709e /t
parent1e07de88832246b317795ed139352f9143853dd8 (diff)
downloadmanatools-40afb16ec80e02645b6d87e460e328c74eb23bba.tar
manatools-40afb16ec80e02645b6d87e460e328c74eb23bba.tar.gz
manatools-40afb16ec80e02645b6d87e460e328c74eb23bba.tar.bz2
manatools-40afb16ec80e02645b6d87e460e328c74eb23bba.tar.xz
manatools-40afb16ec80e02645b6d87e460e328c74eb23bba.zip
Added an attempt to write a urpmi backend ported open_db
Diffstat (limited to 't')
-rw-r--r--t/09-Shared-urpmi_backend.t32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/09-Shared-urpmi_backend.t b/t/09-Shared-urpmi_backend.t
new file mode 100644
index 00000000..c5501b41
--- /dev/null
+++ b/t/09-Shared-urpmi_backend.t
@@ -0,0 +1,32 @@
+use 5.006;
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use Data::Dumper;
+
+BEGIN {
+ use_ok( 'ManaTools::Shared::urpmi_backend::DB' ) || print "ManaTools::Shared::urpmi_backend::DB failed!\n";
+}
+
+ok ( my $obj = ManaTools::Shared::urpmi_backend::DB->new(), 'new');
+is ( ref($obj->open_rpm_db()), 'URPM::DB', 'open_rpm_db');
+my $urpm = $obj->open_urpmi_db();
+is ( ref($urpm), 'urpm', 'open_urpmi_db');
+is ( $obj->lock($urpm), 0, 'lock(already locked)');
+undef ($urpm->{lock});
+$urpm = $obj->fast_open_urpmi_db();
+is ( ref($urpm), 'urpm', 'fast_open_urpmi_db');
+is ( $obj->lock($urpm), 1, 'lock(locked)');
+is ( $obj->unlock($urpm), undef, 'unlock');
+
+
+ok ( my $resp = ($obj->is_it_a_devel_distro() ? 'yes' : 'no'), 'is_it_a_devel_distro');
+diag "\tis_it_a_devel_distro? < " . $resp . " >";
+ok ( $resp = $obj->get_backport_media($urpm), 'get_backport_media');
+diag "\tfound < " . $resp . " > backport media";
+ok ( $resp = $obj->get_inactive_backport_media($urpm), 'get_inactive_backport_media');
+diag "\tfound < " . $resp . " > inactive backport media";
+ok ( $resp = $obj->get_update_medias($urpm), 'get_update_medias');
+diag "\tfound < " . $resp . " > update media";
+
+done_testing;