diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-06-29 13:30:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-06-29 13:30:24 +0000 |
commit | 6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217 (patch) | |
tree | 7e5723a41d828799e9759547bfd72c0133ba297f /t/sign.t | |
download | mga-youri-submit-upstream.tar mga-youri-submit-upstream.tar.gz mga-youri-submit-upstream.tar.bz2 mga-youri-submit-upstream.tar.xz mga-youri-submit-upstream.zip |
prepare mergeupstream
Diffstat (limited to 't/sign.t')
-rwxr-xr-x | t/sign.t | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/t/sign.t b/t/sign.t new file mode 100755 index 0000000..db6f619 --- /dev/null +++ b/t/sign.t @@ -0,0 +1,57 @@ +#!/usr/bin/perl +# $Id: sign.t 1407 2006-12-03 12:02:02Z guillomovitch $ + +use Test::More tests => 3; +use Test::Exception; +use File::Basename; +use Youri::Package::RPM::Generator; +use Youri::Package::RPM::URPM; +use Youri::Submit::Action::Sign; + +my $action1 = Youri::Submit::Action::Sign->new( + name => 'Youri', + path => dirname($0) . '/gpghome', + passphrase => 'Youri sux', + skip => [ 'cheater' ] +); + +dies_ok { + $action1->run( + Youri::Package::RPM::URPM->new( + file => Youri::Package::RPM::Generator->new()->get_source(), + ), + undef, + undef, + undef + ) +} 'signing with wrong key'; + +lives_ok { + $action1->run( + Youri::Package::RPM::URPM->new( + file => Youri::Package::RPM::Generator->new(tags => { + name => 'cheater', + })->get_source(), + ), + undef, + undef, + undef + ) +} 'signing with wrong key using an exception'; + +my $action2 = Youri::Submit::Action::Sign->new( + name => 'Youri', + path => dirname($0) . '/gpghome', + passphrase => 'Youri rulez', +); + +lives_ok { + $action2->run( + Youri::Package::RPM::URPM->new( + file => Youri::Package::RPM::Generator->new()->get_source(), + ), + undef, + undef, + undef + ) +} 'signing with correct key'; |