def test_get_imap(self): test_ilst = tuple(np.linspace(0, 1, ginga.imap.min_imap_len)) ginga.imap.add_imap('test-name', test_ilst) expected = IntensityMap('test-name', test_ilst) actual = ginga.imap.get_imap('test-name') assert expected.name == actual.name assert np.allclose(expected.ilst, actual.ilst) # Teardown del ginga.imap.imaps['test-name']
def test_IntensityMap_init(self): test_ilst = tuple(np.linspace(0, 1, ginga.imap.min_imap_len)) test_intensity_map = IntensityMap('test-name', test_ilst) expected = 'test-name' actual = test_intensity_map.name assert expected == actual expected = ginga.imap.min_imap_len actual = len(test_intensity_map.ilst) assert expected == actual expected = test_ilst actual = test_intensity_map.ilst assert np.allclose(expected, actual)
def test_IntensityMap_init_exception(self): with pytest.raises(TypeError): IntensityMap('test-name')