Mercurial > hg > tvii
view tests/test_sigmoid.py @ 21:0149be5a984c
[iterable] add function to tell True/False if argument is an iterable
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 04 Sep 2017 08:37:06 -0700 |
parents | d6d2ecb33c95 |
children | 38aa9098bf2d |
line wrap: on
line source
#!/usr/bin/env python """ test sigmoid related functionality """ import os import unittest from tvii.sigmoid import sigmoid class TestSigmoid(unittest.TestCase): def test_basic(self): """test two points of the sigmoid function""" answer = sigmoid([0,2]) assert len(answer) == 2 assert answer[0] == 0.5 assert abs(answer[1] - 0.88079708) < 1e-6 if __name__ == '__main__': unittest.main()