lemonldap-ng/lemonldap-ng-manager/t/06-rest-api-RSA.t

33 lines
713 B
Perl
Raw Normal View History

2016-01-07 12:40:24 +01:00
# Test RSA key generation
use Test::More;
use strict;
2016-01-13 20:47:56 +01:00
use JSON;
use IO::String;
2015-05-14 08:45:03 +02:00
require 't/test-lib.pm';
my $res;
ok(
2016-01-01 20:55:35 +01:00
$res = &client->_post(
'/confs/newRSAKey', '', IO::String->new(''), 'application/json', 0,
),
"Request succeed"
);
ok( $res->[0] == 200, "Result code is 200" );
my $key;
2016-01-11 21:32:44 +01:00
ok( $key = from_json( $res->[2]->[0] ), 'Response is JSON' );
count(3);
ok(
2016-01-01 20:55:35 +01:00
$res = &client->_post(
'/confs/newRSAKey', '', IO::String->new('{"password":"hello"}'),
'application/json', 20,
),
"Request succeed"
);
2020-02-20 23:34:02 +01:00
ok( $res->[0] == 200, "Result code is 200" );
2016-01-11 21:32:44 +01:00
ok( $key = from_json( $res->[2]->[0] ), 'Response is JSON' );
count(3);
2015-10-22 10:40:12 +02:00
done_testing( count() );