adjust tests with new outputs

This commit is contained in:
Andy Eschbacher 2018-03-01 09:26:53 -05:00
parent 7b1ce57abc
commit c1ca03e159

View File

@ -71,10 +71,10 @@ class MoranTest(unittest.TestCase):
random_seeds.set_random_seeds(1234)
result = moran.local_stat('subquery', 'value',
'knn', 5, 99, 'the_geom', 'cartodb_id')
result = [(row[0], row[1]) for row in result]
result = [(row[0], row[6]) for row in result]
zipped_values = zip(result, self.moran_data)
for ([res_val, res_quad], [exp_val, exp_quad]) in zipped_values:
for ([res_quad, res_val], [exp_val, exp_quad]) in zipped_values:
self.assertAlmostEqual(res_val, exp_val)
self.assertEqual(res_quad, exp_quad)
@ -89,11 +89,11 @@ class MoranTest(unittest.TestCase):
moran = Moran(FakeDataProvider(data))
result = moran.local_rate_stat('subquery', 'numerator', 'denominator',
'knn', 5, 99, 'the_geom', 'cartodb_id')
result = [(row[0], row[1]) for row in result]
result = [(row[0], row[6]) for row in result]
zipped_values = zip(result, self.moran_data)
for ([res_val, res_quad], [exp_val, exp_quad]) in zipped_values:
for ([res_quad, res_val], [exp_val, exp_quad]) in zipped_values:
self.assertAlmostEqual(res_val, exp_val)
def test_moran(self):