Mercurial > p > mysql-python > mysqldb-2
changeset 37:df4d804244ec MySQLdb
Since tests are easy to run, there's no reason to have them in shipping code.
author | kylev |
---|---|
date | Thu, 12 Feb 2009 00:36:39 +0000 |
parents | 38bf72f3c3de |
children | 0da42144a012 |
files | MySQLdb/__init__.py tests/test_MySQLdb_nonstandard.py |
diffstat | 2 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/MySQLdb/__init__.py Thu Feb 12 00:28:34 2009 +0000 +++ b/MySQLdb/__init__.py Thu Feb 12 00:36:39 2009 +0000 @@ -58,18 +58,6 @@ DATETIME = TIMESTAMP ROWID = DBAPISet() -def test_DBAPISet_set_equality(): - assert STRING == STRING - -def test_DBAPISet_set_inequality(): - assert STRING != NUMBER - -def test_DBAPISet_set_equality_membership(): - assert FIELD_TYPE.VAR_STRING == STRING - -def test_DBAPISet_set_inequality_membership(): - assert FIELD_TYPE.DATE != STRING - def Binary(x): """Return x as a binary type.""" return str(x)
--- a/tests/test_MySQLdb_nonstandard.py Thu Feb 12 00:28:34 2009 +0000 +++ b/tests/test_MySQLdb_nonstandard.py Thu Feb 12 00:36:39 2009 +0000 @@ -1,6 +1,21 @@ import unittest import MySQLdb +from MySQLdb.constants import FIELD_TYPE + + +class TestDBAPISet(unittest.TestCase): + def test_set_equality(self): + self.assertTrue(MySQLdb.STRING == MySQLdb.STRING) + + def test_set_inequality(self): + self.assertTrue(MySQLdb.STRING != MySQLdb.NUMBER) + + def test_set_equality_membership(self): + self.assertTrue(FIELD_TYPE.VAR_STRING == MySQLdb.STRING) + + def test_set_inequality_membership(self): + self.assertTrue(FIELD_TYPE.DATE != MySQLdb.STRING) class NonStandard(unittest.TestCase):