Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(18)  |  Call(16)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_parse/test_mage.py   cogent(Download)
#!/usr/bin/env python
"""Tests of MageParser
"""
from cogent.util.unit_test import TestCase, main
from cogent.parse.mage import MageParser, MageGroupFromString,\
    def test_MagePointFromString(self):
        """MagePoint should fill itself from string correctly"""
        m = MagePointFromString('{construction}width5  0.000 0.707 -1.225\n')
        self.assertEqual(str(m), \
        '{construction} width5 ' + ' '.join(map(str, [0.0,0.707,-1.225])))
        m = MagePointFromString('3, 4, 5')
        self.assertEqual(str(m), ' '.join(map(str, map(float, [3, 4, 5]))))
        m = MagePointFromString('{b2}P 0.000 0.000 0.000')
        self.assertEqual(str(m), '{b2} P ' + \
            ' '.join(map(str, map(float, [0,0,0]))))
        m = MagePointFromString('P -2650192.000 4309510.000 3872241.000')
        self.assertEqual(str(m), 'P ' + \
            ' '.join(map(str, map(float, [-2650192,4309510,3872241]))))

src/p/y/pycogent-HEAD/tests/test_parse/test_mage.py   pycogent(Download)
#!/usr/bin/env python
"""Tests of MageParser
"""
from cogent.util.unit_test import TestCase, main
from cogent.parse.mage import MageParser, MageGroupFromString,\
    def test_MagePointFromString(self):
        """MagePoint should fill itself from string correctly"""
        m = MagePointFromString('{construction}width5  0.000 0.707 -1.225\n')
        self.assertEqual(str(m), \
        '{construction} width5 ' + ' '.join(map(str, [0.0,0.707,-1.225])))
        m = MagePointFromString('3, 4, 5')
        self.assertEqual(str(m), ' '.join(map(str, map(float, [3, 4, 5]))))
        m = MagePointFromString('{b2}P 0.000 0.000 0.000')
        self.assertEqual(str(m), '{b2} P ' + \
            ' '.join(map(str, map(float, [0,0,0]))))
        m = MagePointFromString('P -2650192.000 4309510.000 3872241.000')
        self.assertEqual(str(m), 'P ' + \
            ' '.join(map(str, map(float, [-2650192,4309510,3872241]))))