OpenSSL-Query: add request tests with tagged identities
authorRichard Levitte <levitte@openssl.org>
Sun, 25 Jun 2017 05:17:21 +0000 (07:17 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 25 Jun 2017 05:24:35 +0000 (07:24 +0200)
t/query.t

index f167a666fbd39725a9f00931a4f8bfc37622f6b2..5cb7c25f8221ac112b4e40269000884f7b5edca2 100644 (file)
--- a/t/query.t
+++ b/t/query.t
@@ -11,7 +11,7 @@ use Test::More;
 use OpenSSL::Query::REST;
 use Data::Dumper;
 
-plan tests => 12;
+plan tests => 15;
 
 SKIP: {
   my $query;
@@ -42,6 +42,18 @@ SKIP: {
     note( Dumper( { %res2 } ) );
   };
 
+  subtest 'Request of person data for Ray Bradbury as full name' => sub {
+    plan tests => 2;
+
+    my $res1 = $query->find_person( { fullname => 'Ray Bradbury' } );
+    ok( $res1, 'Ray Bradbury is present' );
+    note( $res1 );
+
+    my %res2 = $query->find_person( 'Ray Bradbury' );
+    ok(scalar keys %res2 > 1, "Got Ray Bradbury's data" );
+    note( Dumper( { %res2 } ) );
+  };
+
   subtest 'Request of membership in specific group for Ray Bradbury' => sub {
     plan tests => 1;
     my $res = $query->is_member_of( 'Ray Bradbury', 'scifi' );
@@ -49,6 +61,13 @@ SKIP: {
     note( $res );
   };
 
+  subtest 'Request of membership in specific group for Ray Bradbury as full name' => sub {
+    plan tests => 1;
+    my $res = $query->is_member_of( { fullname => 'Ray Bradbury' }, 'scifi' );
+    ok( $res, "Ray Bradbury is member of scifi since ".( $res ? $res : "(unknown)" ) );
+    note( $res );
+  };
+
   subtest 'Request of "author" tag value for Ray Bradbury' => sub {
     plan tests => 1;
     my $res = $query->find_person_tag( 'Ray Bradbury', 'author' );
@@ -56,6 +75,13 @@ SKIP: {
     note( Dumper $res );
   };
 
+  subtest 'Request of "author" tag value for Ray Bradbury as full name' => sub {
+    plan tests => 1;
+    my $res = $query->find_person_tag( { fullname => 'Ray Bradbury' }, 'author' );
+    ok( $res, "The 'author' tag for Ray Bradbury is ".( $res ? $res : "(unknown)" ) );
+    note( Dumper $res );
+  };
+
   subtest 'Request of CLA status for Ray Bradbury' => sub {
     plan tests => 1;
     my $res = $query->has_cla( 'ray@ourplace.com' );