Skip to content

Commit 13c0eef

Browse files
committed
- add test to check correct tenure types used
1 parent 3f82e43 commit 13c0eef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/jobs/housing/housing_dwellings_list_gx_suite.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import great_expectations as gx
77
import great_expectations.expectations as gxe
88

9+
910
class ExpectLLPGColumnValuesToBeUnique(gxe.ExpectColumnValuesToBeUnique):
1011
column: str = 'llpg'
1112
description: str = "Expect UPRN (LLPG) values to be unique"
@@ -46,6 +47,14 @@ class ExpectEstateRefNoColumnValuesToMatchRegex(gxe.ExpectColumnValuesToMatchReg
4647
description: str = "Expect Estate Reference Number to match regex ^[0-9]\d+$ (numerical)"
4748

4849

50+
class ExpectTenureValuesToBeInSet(gxe.ExpectColumnValuesToBeInSet):
51+
column: str = 'tenure'
52+
value_set: list = ['Asylum Seeker', 'Freehold', 'Freehold (Serv)', 'Introductory',
53+
'Leasehold (RTB)', 'Lse 100% Stair', 'Mesne Profit Ac', 'Non-Secure',
54+
'Private Sale LH', 'Secure', 'Shared Owners', 'Short Life Lse', 'Temp Decant',
55+
'Shared Equity']
56+
description: str = "Expect tenure values to contain one of the set"
57+
4958

5059
arg_key = ['s3_target_location']
5160
args = getResolvedOptions(sys.argv, arg_key)
@@ -63,5 +72,6 @@ class ExpectEstateRefNoColumnValuesToMatchRegex(gxe.ExpectColumnValuesToMatchReg
6372
suite.add_expectation(ExpectBlockRefNoColumnValuesToMatchRegex())
6473
suite.add_expectation(ExpectLLPGColumnValuesToMatchRegex())
6574
suite.add_expectation(ExpectEstateRefNoColumnValuesToMatchRegex())
75+
suite.add_expectation(ExpectTenureValuesToBeInSet())
6676

6777
suite = context.suites.add(suite)

0 commit comments

Comments
 (0)