Skip to content

Commit

Permalink
Check that list_samplers returns a list
Browse files Browse the repository at this point in the history
  • Loading branch information
DougBurke committed Sep 10, 2017
1 parent fa6d366 commit 16cb167
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions sherpa/sim/tests/test_sim_unit.py
@@ -0,0 +1,37 @@
#
# Copyright (C) 2017 Smithsonian Astrophysical Observatory
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

from sherpa import sim

# This is part of #397
#
def test_list_samplers():
"""Ensure list_samplers returns a list."""

mcmc = sim.MCMC()
samplers = mcmc.list_samplers()

assert isinstance(samplers, list)
assert len(samplers) > 0

# Test that the expected values exist in this list,
# but do not enforce these are the only values.
#
for expected in ['mh', 'metropolismh']:
assert expected in samplers

0 comments on commit 16cb167

Please sign in to comment.