File: test_standard_array_spec.py

package info (click to toggle)
python-scipy 0.10.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,232 kB
  • sloc: cpp: 224,773; ansic: 103,496; python: 85,210; fortran: 79,130; makefile: 272; sh: 43
file content (30 lines) | stat: -rw-r--r-- 760 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from numpy import arange
from numpy.testing import TestCase, assert_

from scipy.weave import standard_array_spec

def remove_whitespace(in_str):
    out = in_str.replace(" ","")
    out = out.replace("\t","")
    out = out.replace("\n","")
    return out


class TestArrayConverter(TestCase):

    def test_type_match_string(self):
        s = standard_array_spec.array_converter()
        assert_( not s.type_match('string') )

    def test_type_match_int(self):
        s = standard_array_spec.array_converter()
        assert_(not s.type_match(5))

    def test_type_match_array(self):
        s = standard_array_spec.array_converter()
        assert_(s.type_match(arange(4)))


if __name__ == "__main__":
    import nose
    nose.run(argv=['', __file__])