def test_coordinates_are_lists_of_ints(self): heatmap = load.heatmap(123, channel_id=1) self.assertIsInstance(heatmap.X, list) self.assertIsInstance(heatmap.Y, list) for element in heatmap.X: self.assertIsInstance(element, int) for element in heatmap.Y: self.assertIsInstance(element, int)
def test_channel_is_list_of_floats(self): heatmap = load.heatmap(123, channel_id=1) self.assertIsInstance(heatmap.Intensities, list) for element in heatmap.Intensities: self.assertIsInstance(element, float)
def test_throws_when_channel_does_not_exist(self): with self.assertRaises(IndexError): load.heatmap(123, channel_id=123456789)
def test_loads_given_channel(self): heatmap = load.heatmap(123, channel_id=1) self.assertEqual(heatmap.Intensities, [12, 22, 32, 42, 52])
def heatmap(dataset_id: int): channel_id = require('channelId', int) return as_response(load.heatmap(dataset_id, channel_id))