-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildings_functions.pg
47 lines (36 loc) · 1.25 KB
/
buildings_functions.pg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
------------------------------------------------------------------------------
-- Provide unit testing for buildings functions using pgTAP
------------------------------------------------------------------------------
-- Turn off echo.
\set QUIET 1
-- Format the output nicely.
\pset format unaligned
\pset tuples_only true
\pset pager
-- Revert all changes on failure.
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true
BEGIN;
SELECT plan(3);
-- Tests
--Buildings-------------------------
SELECT set_has(
'SELECT building_id FROM buildings.buildings',
$$VALUES (1000029)$$,
'Check contents of buildings table after buildings_insert function has run'
);
--Building Outlines-------------------------
SELECT set_has(
'SELECT building_outline_id FROM buildings.building_outlines',
$$VALUES (1000033)$$,
'Check contents of building outlines table after building_outlines_insert function has run'
);
--Existing Subset Extracts-------------------------
SELECT set_has(
'SELECT building_outline_id FROM buildings_bulk_load.existing_subset_extracts',
$$VALUES (1000000)$$,
'Check contents of existing subset extracts table after existing_subset_extracts_insert function has run'
);
-- Finish pgTAP testing
SELECT * FROM finish();
ROLLBACK;