1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst |
||
2 | from __future__ import absolute_import, division, print_function, unicode_literals |
||
3 | import pytest |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
4 | from ....utils.testing import assert_quantity_allclose |
||
5 | from .. import profiles |
||
6 | |||
7 | dm_profiles = [ |
||
8 | profiles.NFWProfile, |
||
9 | profiles.EinastoProfile, |
||
10 | profiles.IsothermalProfile, |
||
11 | profiles.BurkertProfile, |
||
12 | profiles.MooreProfile, |
||
13 | ] |
||
14 | |||
15 | |||
16 | @pytest.mark.parametrize("profile", dm_profiles) |
||
17 | def test_profiles(profile): |
||
18 | p = profile() |
||
19 | p.scale_to_local_density() |
||
20 | actual = p(p.DISTANCE_GC) |
||
21 | desired = p.LOCAL_DENSITY |
||
22 | |||
23 | assert_quantity_allclose(actual, desired) |
||
24 |