import pgdb
+import Configuration.Defaults
import GPS
import SummaryFile1
one or two methods from within this class.
"""
- def __init__(self, _host, _database, _username, _srid):
- self.connection = pgdb.connect(host=_host,
- database=_database,
- user=_username)
- self.srid = _srid
+ def __init__(self,
+ initial_host=Configuration.Defaults.DATABASE_HOST,
+ initial_database=Configuration.Defaults.DATABASE_NAME,
+ initial_username=Configuration.Defaults.DATABASE_USERNAME,
+ initial_srid=Configuration.Defaults.SRID):
+
+ self.connection = pgdb.connect(host=initial_host,
+ database=initial_database,
+ user=initial_username)
+ self.srid = initial_srid
def __del__(self):
import unittest
import Census
-import Configuration.Defaults
-import GPS
import SummaryFile1
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):