diff options
Diffstat (limited to 'lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_db_model.py')
-rw-r--r-- | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_db_model.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_db_model.py b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_db_model.py deleted file mode 100644 index 99af34ef..00000000 --- a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_db_model.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file is part of Buildbot. Buildbot is free software: you can -# redistribute it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation, version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright Buildbot Team Members - -import os -import mock -from twisted.trial import unittest -from twisted.internet import defer -from buildbot.db import model, enginestrategy -from buildbot.test.util import db - -class DBConnector_Basic(db.RealDatabaseMixin, unittest.TestCase): - """ - Basic tests of the DBConnector class - all start with an empty DB - """ - - def setUp(self): - d = self.setUpRealDatabase() - def make_fake_pool(_): - engine = enginestrategy.create_engine(self.db_url, - basedir=os.path.abspath('basedir')) - - # mock out the pool, and set up the model - self.db = mock.Mock() - self.db.pool.do_with_engine = lambda thd : defer.maybeDeferred(thd,engine) - self.db.model = model.Model(self.db) - self.db.start() - d.addCallback(make_fake_pool) - return d - - def tearDown(self): - self.db.stop() - return self.tearDownRealDatabase() - - def test_is_current_empty(self): - d = self.db.model.is_current() - d.addCallback(lambda r : self.assertFalse(r)) - return d - - def test_is_current_full(self): - d = self.db.model.upgrade() - d.addCallback(lambda _ : self.db.model.is_current()) - d.addCallback(lambda r : self.assertTrue(r)) - return d - - # the upgrade method is very well-tested by the integration tests; the - # remainder of the object is just tables. |