@@ -14,10 +14,10 @@ skip_if_no_python_api = function() {
14
14
15
15
# simply checks we can get nomis geo codes back
16
16
test_that(" geoCodeLookup" , {
17
- expect_true(UKCensusAPI :: geoCodeLookup(api , " MSOA11" ) == 297 )
18
- expect_true(UKCensusAPI :: geoCodeLookup(api , " LSOA01" ) == 304 )
19
- expect_true(UKCensusAPI :: geoCodeLookup(api , " LAD" ) == 464 )
20
- expect_true(UKCensusAPI :: geoCodeLookup(api , " EnglandWales" ) == 2092957703 )
17
+ expect_true(UKCensusAPI :: geoCodeLookup(api , " MSOA11" ) == " TYPE297 " )
18
+ expect_true(UKCensusAPI :: geoCodeLookup(api , " LSOA01" ) == " TYPE304 " )
19
+ expect_true(UKCensusAPI :: geoCodeLookup(api , " LAD" ) == " TYPE464 " )
20
+ expect_true(UKCensusAPI :: geoCodeLookup(api , " EnglandWales" ) == " 2092957703" )
21
21
})
22
22
23
23
# simply checks we get data back
@@ -31,14 +31,13 @@ test_that("getMetadata", {
31
31
test_that(" getData" , {
32
32
skip_if_no_python_api()
33
33
table = " KS401EW"
34
- table_internal = " NM_618_1"
35
34
query = list (date = " latest" ,
36
35
geography = " 1245714681...1245714688" ,
37
36
CELL = " 7...13" ,
38
37
RURAL_URBAN = " 0" ,
39
38
measures = " 20100" ,
40
39
select = " GEOGRAPHY_CODE,CELL,OBS_VALUE" )
41
- expect_true(class(UKCensusAPI :: getData(api , table , table_internal , query )) == " data.frame" )
40
+ expect_true(class(UKCensusAPI :: getData(api , table , query )) == " data.frame" )
42
41
43
42
})
44
43
@@ -65,45 +64,44 @@ test_that("getLADCodes", {
65
64
66
65
test_that(" geoCodes empty" , {
67
66
skip_if_no_python_api()
68
- expect_true(geoCodes(api , c(), 999 ) == " " )
67
+ expect_true(geoCodes(api , c(), " TYPE999 " ) == " " )
69
68
})
70
69
71
70
test_that(" geoCodes invalid" , {
72
71
skip_if_no_python_api()
73
- expect_true(geoCodes(api , c(999 ), 999 ) == " " )
72
+ expect_true(geoCodes(api , c(999 ), " TYPE999 " ) == " " )
74
73
})
75
74
76
75
test_that(" geoCodes single LA" , {
77
76
skip_if_no_python_api()
78
- expect_true(geoCodes(api , 1946157124 , 464 ) == " 1946157124" )
77
+ expect_true(geoCodes(api , 1946157124 , " TYPE464 " ) == " 1946157124" )
79
78
})
80
79
81
80
test_that(" geoCodes multi MSOA" , {
82
81
skip_if_no_python_api()
83
- expect_true(geoCodes(api , c(1946157124 , 1946157128 ), 297 ) == " 1245710411...1245710471,1245710661...1245710705" )
82
+ expect_true(geoCodes(api , c(1946157124 , 1946157128 ), " TYPE297 " ) == " 1245710411...1245710471,1245710661...1245710705" )
84
83
})
85
84
86
85
test_that(" geoCodes multi LSOA" , {
87
86
skip_if_no_python_api()
88
- expect_true(geoCodes(api , c(1946157124 , 1946157128 ), 298 ) == " 1249912854...1249913154,1249913980...1249914188,1249935357...1249935365" )
87
+ expect_true(geoCodes(api , c(1946157124 , 1946157128 ), " TYPE298 " ) == " 1249912854...1249913154,1249913980...1249914188,1249935357...1249935365" )
89
88
})
90
89
91
90
test_that(" geoCodes single OA" , {
92
91
skip_if_no_python_api()
93
- expect_true(geoCodes(api , 1946157124 , 299 ) == " 1254148629...1254150034,1254267588...1254267709" )
92
+ expect_true(geoCodes(api , 1946157124 , " TYPE299 " ) == " 1254148629...1254150034,1254267588...1254267709" )
94
93
})
95
94
96
95
test_that(" contextify" , {
97
96
skip_if_no_python_api()
98
97
table = " KS401EW"
99
- table_internal = " NM_618_1"
100
98
query = list (date = " latest" ,
101
99
geography = " 1245714681...1245714688" ,
102
100
CELL = " 7...13" ,
103
101
RURAL_URBAN = " 0" ,
104
102
measures = " 20100" ,
105
103
select = " GEOGRAPHY_CODE,CELL,OBS_VALUE" )
106
- data = UKCensusAPI :: getData(api , table , table_internal , query )
104
+ data = UKCensusAPI :: getData(api , table , query )
107
105
column = " CELL"
108
106
109
107
data = contextify(api , table , column , data )
0 commit comments