]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - src/Tests/Unit/CensusTest.py
Separate the tests that hit the database from the rest of the tests.
[dead/census-tools.git] / src / Tests / Unit / CensusTest.py
index dd18e7c3c7fd3c56b59402dbdf1e3cf3f7df2a27..531d4dd0a615a2d7d27afbee8f0e36c5ebbe2cf1 100644 (file)
@@ -1,8 +1,6 @@
 import unittest
 
 import Census
-import Configuration.Defaults
-import GPS
 import SummaryFile1
 import Tests.Fixtures
 
@@ -10,10 +8,7 @@ import Tests.Fixtures
 class DatabaseTest(unittest.TestCase):
 
     def setUp(self):
-        self.cdb = Census.Database(Configuration.Defaults.DATABASE_HOST,
-                                   Configuration.Defaults.DATABASE_NAME,
-                                   Configuration.Defaults.DATABASE_USERNAME,
-                                   Configuration.Defaults.SRID)
+        self.cdb = Census.Database()
         
         
     def testEachBlockContainsItsOwnPopulation(self):
@@ -37,7 +32,13 @@ class DatabaseTest(unittest.TestCase):
             
     
 def suite():
+    # Tests that don't hit the database.
     suite = unittest.TestSuite()
-    suite.addTest(unittest.makeSuite(DatabaseTest))
     return suite
-        
+
+
+def db_suite():
+    # The tests that hit the database.
+    db_suite = unittest.TestSuite()
+    db_suite.addTest(unittest.makeSuite(DatabaseTest))
+    return db_suite