Change to project/trunk,tags,branches style

This commit is contained in:
Faik Uygur
2009-10-14 12:42:24 +00:00
commit 54e89f07b4
1121 changed files with 136747 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007, TUBITAK/UEKAE
#
# This program 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; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import unittest
import pisi.db.lazydb as lazydb
class TestDB(lazydb.LazyDB):
def init(self):
self.testfield = True
def getTestField(self):
return self.testfield
class LazyDBTestCase(unittest.TestCase):
def testDatabaseMethodForcingInit(self):
db = TestDB()
db.getTestField()
assert db.__dict__.has_key("testfield")
del TestDB._the_instance
def testDatabaseWithoutInit(self):
db = TestDB()
assert not db.__dict__.has_key("testfield")
del TestDB._the_instance
def testSingletonBehaviour(self):
db = TestDB()
db2 = TestDB()
assert id(db) == id(db2)