File: test80_error_tests.sql

package info (click to toggle)
mimeo 1.5.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,276 kB
  • sloc: sql: 85,916; python: 81; makefile: 27; sh: 17
file content (24 lines) | stat: -rw-r--r-- 2,620 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true

SELECT set_config('search_path','mimeo, dblink, public',false);

SELECT plan(10);

SELECT throws_ok('SELECT refresh_snap(''fake_snap_test'')', 'Destination table given in argument (fake_snap_test) is not managed by mimeo', 'Testing refresh_snap exception block');
SELECT throws_ok('SELECT refresh_table(''fake_table_test'')', 'Destination table given in argument (fake_table_test) is not managed by mimeo', 'Testing refresh_table exception block');
SELECT throws_ok('SELECT refresh_inserter(''fake_inserter_test'')', 'Destination table given in argument (fake_inserter_test) is not managed by mimeo', 'Testing refresh_inserter exception block');
SELECT throws_ok('SELECT refresh_updater(''fake_updater_test'')', 'Destination table given in argument (fake_updater_test) is not managed by mimeo', 'Testing refresh_updater exception block');
SELECT throws_ok('SELECT refresh_dml(''fake_dml_test'')', 'Destination table given in argument (fake_dml_test) is not managed by mimeo', 'Testing refresh_dml exception block');
SELECT throws_ok('SELECT refresh_logdel(''fake_logdel_test'')', 'Destination table given in argument (fake_logdel_test) is not managed by mimeo', 'Testing refresh_logdel exception block');

SELECT throws_ok('SELECT mimeo.inserter_maker(''mimeo_source.inserter_test_source'',''serial'',''col1'',data_source_id,''5'',''mimeo_dest.inserter_test_dest'') FROM mimeo.dblink_mapping_mimeo WHERE username = ''mimeo_test''', 'Inserter replication already defined for mimeo_dest.inserter_test_dest', 'Testing unique inserter trigger');

SELECT throws_ok('SELECT inserter_maker(''mimeo_source.inserter_test_source'', ''time'', ''col3'', data_source_id, ''0'', ''mimeo_dest.inserter_test_dest_serial'') FROM dblink_mapping_mimeo WHERE username = ''mimeo_test''', 'Inserter replication already defined for mimeo_dest.inserter_test_dest_serial', 'Testing unique inserter trigger');

SELECT throws_ok('SELECT updater_maker(''mimeo_source.updater_test_source'', ''serial'', ''col1'', data_source_id, ''5'', ''mimeo_dest.updater_test_dest'') FROM dblink_mapping_mimeo WHERE username = ''mimeo_test''', 'Updater replication already defined for mimeo_dest.updater_test_dest', 'Testing unique updater trigger');

SELECT throws_ok('SELECT updater_maker(''mimeo_source.updater_test_source'', ''time'', ''col3'', data_source_id, ''0'', ''mimeo_dest.updater_test_dest_serial'') FROM dblink_mapping_mimeo WHERE username = ''mimeo_test''', 'Updater replication already defined for mimeo_dest.updater_test_dest_serial', 'Testing unique updater trigger');


SELECT * FROM finish();