コード例 #1
0
ファイル: rng_test.py プロジェクト: pygsl/pygsl
def convert_rng_names():
    names = rngmodule.list_available_rngs()
    result = []
    for name in names:
        tmp = name.replace('-', '_')
        result.append(tmp)
    result = tuple(result)
    return result
コード例 #2
0
ファイル: rng_test.py プロジェクト: sarattall/old-intersect
 def test(self):
     refrng = rngmodule.rng()
     mylist = rngmodule.list_available_rngs()
     for i in mylist:
         if i == "knuthran2002":
             continue
         r = getattr(rngmodule, i)()
         test = 0
         try:
             assert type(r) == type(refrng)
             test = 1
         finally:
             if test == 0:
                 print "r      = %s %s" % (type(r), repr(r))
                 print "refrng = %s %s" % (type(refrng), repr(refrng))
コード例 #3
0
 def test(self):
     refrng = rngmodule.rng()
     mylist = rngmodule.list_available_rngs()
     for i in mylist:
         if i == "knuthran2002":
             continue
         r = getattr(rngmodule, i)()
         test = 0
         try:
             assert (type(r) == type(refrng))
             test = 1
         finally:
             if test == 0:
                 print "r      = %s %s" % (type(r), repr(r))
                 print "refrng = %s %s" % (type(refrng), repr(refrng))
コード例 #4
0
ファイル: rng_test.py プロジェクト: sarattall/old-intersect
import types
import unittest
import math
import copy
import pygsl._numobj as Numeric
import pygsl._mlab as MLab
import pygsl.rng as rngmodule
import sys

sys.stdout = sys.stderr
rng_types = rngmodule.list_available_rngs()
from pygsl import Float, Int
from array_check import array_check
from gsl_test import isfloat, iscomplex


class _rng_type:
    _type = None


class _rng_basics(unittest.TestCase):
    """
    here are things tested like allocation, destruction, initialisation
    """

    def test_alloc(self):
        """
        allocate the default rng
        """

        rng = self._type()
コード例 #5
0
import types
import unittest
import math
import copy
import pygsl._numobj as Numeric
import pygsl._mlab as MLab
import pygsl.rng as rngmodule
import sys
sys.stdout = sys.stderr
rng_types = rngmodule.list_available_rngs()
from pygsl import Float, Int
from array_check import array_check
from gsl_test import isfloat, iscomplex


class _rng_type:
    _type = None


class _rng_basics(unittest.TestCase):
    """
    here are things tested like allocation, destruction, initialisation
    """
    def test_alloc(self):
        """
        allocate the default rng
        """

        rng = self._type()
        self.failIf(rng.name() == "", "name of rng was \"\"")
        self.failIf(rng.name() is None, "name of rng was None")