|
Lines 21-27
use Modern::Perl;
Link Here
|
| 21 |
use Test::Deep qw( cmp_deeply re ); |
21 |
use Test::Deep qw( cmp_deeply re ); |
| 22 |
use Test::MockTime qw/set_fixed_time set_relative_time restore_time/; |
22 |
use Test::MockTime qw/set_fixed_time set_relative_time restore_time/; |
| 23 |
|
23 |
|
| 24 |
use Test::More tests => 33; |
24 |
use Test::More tests => 34; |
| 25 |
use DateTime; |
25 |
use DateTime; |
| 26 |
use File::Basename; |
26 |
use File::Basename; |
| 27 |
use File::Spec; |
27 |
use File::Spec; |
|
Lines 863-865
subtest 'Tests for timestamp handling' => sub {
Link Here
|
| 863 |
|
863 |
|
| 864 |
$schema->storage->txn_rollback; |
864 |
$schema->storage->txn_rollback; |
| 865 |
}; |
865 |
}; |
| 866 |
- |
866 |
|
|
|
867 |
subtest 'ListSets() tests' => sub { |
| 868 |
|
| 869 |
plan tests => 2; |
| 870 |
|
| 871 |
$schema->storage->txn_begin; |
| 872 |
|
| 873 |
# initial cleanup |
| 874 |
$schema->resultset('OaiSet')->delete; |
| 875 |
|
| 876 |
test_query( |
| 877 |
'ListSets - no sets should return a noSetHierarchy exception', |
| 878 |
{ verb => 'ListSets' }, |
| 879 |
{ |
| 880 |
error => { |
| 881 |
code => 'noSetHierarchy', |
| 882 |
content => 'There are no OAI sets defined', |
| 883 |
} |
| 884 |
} |
| 885 |
); |
| 886 |
|
| 887 |
# Add a couple sets |
| 888 |
AddOAISet({ spec => 'set_1', name => 'Set 1' }); |
| 889 |
AddOAISet({ spec => 'set_2', name => 'Set 2' }); |
| 890 |
|
| 891 |
test_query( |
| 892 |
'ListSets - no sets should return a noSetHierarchy exception', |
| 893 |
{ verb => 'ListSets' }, |
| 894 |
{ |
| 895 |
ListSets => { |
| 896 |
set => [ |
| 897 |
{ setSpec => 'set_1', setName => 'Set 1' }, |
| 898 |
{ setSpec => 'set_2', setName => 'Set 2' }, |
| 899 |
] |
| 900 |
} |
| 901 |
} |
| 902 |
); |
| 903 |
|
| 904 |
$schema->storage->txn_rollback; |
| 905 |
}; |