[Scipy-svn] r6563 - trunk/scipy/constants/tests

scipy-svn@scip... scipy-svn@scip...
Sat Jun 26 13:53:07 CDT 2010


Author: stefan
Date: 2010-06-26 13:53:07 -0500 (Sat, 26 Jun 2010)
New Revision: 6563

Modified:
   trunk/scipy/constants/tests/test_codata.py
Log:
ENH: Add very basic tests for codata and constants.

Modified: trunk/scipy/constants/tests/test_codata.py
===================================================================
--- trunk/scipy/constants/tests/test_codata.py	2010-06-26 18:53:03 UTC (rev 6562)
+++ trunk/scipy/constants/tests/test_codata.py	2010-06-26 18:53:07 UTC (rev 6563)
@@ -1,6 +1,9 @@
 
 import warnings
 
+import codata
+import constants
+
 from scipy.constants import find
 from numpy.testing import assert_equal, run_module_suite
 
@@ -26,5 +29,15 @@
                                 'natural unit of length',
                                 'natural unit of time']))
 
+
+def test_basic_table_parse():
+    c = 'speed of light in vacuum'
+    assert_equal(codata.value(c), constants.c)
+    assert_equal(codata.value(c), constants.speed_of_light)
+
+def test_basic_lookup():
+    assert_equal('%d %s' % (codata.c, codata.unit('speed of light in vacuum')),
+                 '299792458 m s^-1')
+
 if __name__ == "__main__":
     run_module_suite()



More information about the Scipy-svn mailing list