@@ -39,31 +39,11 @@ def test_caching(self):
3939 """Populate, query, cache, query, and verify the cache."""
4040
4141 # insert dummy data
42- self ._db ._cursor .execute ('''
43- INSERT INTO `signal_dim` (`signal_key_id`, `source`, `signal`)
44- VALUES
45- (42, 'src', 'sig');
46- ''' )
47- self ._db ._cursor .execute ('''
48- INSERT INTO `geo_dim` (`geo_key_id`, `geo_type`, `geo_value`)
49- VALUES
50- (96, 'state', 'pa'),
51- (97, 'state', 'wa');
52- ''' )
53- self ._db ._cursor .execute (f'''
54- INSERT INTO
55- `epimetric_latest` (`epimetric_id`, `signal_key_id`, `geo_key_id`, `time_type`,
56- `time_value`, `value_updated_timestamp`,
57- `value`, `stderr`, `sample_size`,
58- `issue`, `lag`, `missing_value`,
59- `missing_stderr`,`missing_sample_size`)
60- VALUES
61- (15, 42, 96, 'day', 20200422,
62- 123, 1, 2, 3, 20200422, 0, { Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } ),
63- (16, 42, 97, 'day', 20200422,
64- 789, 1, 2, 3, 20200423, 1, { Nans .NOT_MISSING } , { Nans .NOT_MISSING } , { Nans .NOT_MISSING } )
65- ''' )
66- self ._db .commit ()
42+ self ._insert_rows ([
43+ CovidcastTestRow .make_default_row (geo_type = "state" , geo_value = "pa" ),
44+ CovidcastTestRow .make_default_row (geo_type = "state" , geo_value = "ny" ),
45+ CovidcastTestRow .make_default_row (geo_type = "state" , geo_value = "ny" , signal = "sig2" ),
46+ ])
6747
6848 results = self ._make_request ()
6949
0 commit comments