[Greater-commits] r288 - trunk/GREAT-ER-DB/impl/postgresql/test
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Jun 27 18:05:11 CEST 2011
Author: bricks
Date: 2011-06-27 18:05:10 +0200 (Mon, 27 Jun 2011)
New Revision: 288
Modified:
trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_q_temp_sess.py
Log:
fix indentation
Modified: trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_q_temp_sess.py
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_q_temp_sess.py 2011-06-27 15:47:40 UTC (rev 287)
+++ trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_q_temp_sess.py 2011-06-27 16:05:10 UTC (rev 288)
@@ -43,17 +43,16 @@
def setUp(self):
set_api_interface("_dagreater_pg")
self.server = postgressupport.get_test_server()
- self.connection_target = self.server.known_dbs["static_db"].get_connection_target()
- da_db_connect("anonym", "123", self.connection_target)
+ self.connection_target = self.server.known_dbs["static_db"].get_connection_target()
+ da_db_connect("anonym", "123", self.connection_target)
def test_0_create_temp_sess(self):
- # if you do individual tests, you have to adjust the sess_id's, because there
- # is only 1 sess in the db (inserted by the insert.sql). the id da_create_temp_sess()
- # returns will be 102 and not 103.
- self.res = da_create_temp_sess(101,'Y')
- da_db_commit()
- print self.res
- self.assertNotEquals(self.res,0)
+ # if you do individual tests, you have to adjust the sess_id's, because there
+ # is only 1 sess in the db (inserted by the insert.sql). the id da_create_temp_sess()
+ # returns will be 102 and not 103.
+ self.res = da_create_temp_sess(101,'Y')
+ da_db_commit()
+ self.assertNotEquals(self.res,0)
def test_1_make_temp_sess_permanent(self):
self.res = da_get_sess(101,'N')
@@ -68,34 +67,34 @@
self.assertEquals(len(self.res),0)
def test_2_get_temp_sess(self):
- self.res = da_get_sess(101,'Y')
- self.assertEquals(len(self.res),0)
- self.res = da_get_sess(101,'N')
- self.assertEquals(len(self.res),0)
- self.res = da_get_sess(103,'N')
- self.assertNotEquals(len(self.res),0)
- self.res = da_get_sess(103,'Y')
- self.assertEquals(len(self.res),0)
+ self.res = da_get_sess(101,'Y')
+ self.assertEquals(len(self.res),0)
+ self.res = da_get_sess(101,'N')
+ self.assertEquals(len(self.res),0)
+ self.res = da_get_sess(103,'N')
+ self.assertNotEquals(len(self.res),0)
+ self.res = da_get_sess(103,'Y')
+ self.assertEquals(len(self.res),0)
def test_3_cleanup_temp_sess(self):
self.res = da_create_temp_sess(103,'Y')
- self.res = da_get_sess(104,'Y')
+ self.res = da_get_sess(104,'Y')
self.assertNotEquals(self.res,0)
- # there is no chance to test the cleanup function,
- # because the condition for deleting is that
- # the sess. has to be older than 7 days (current_timestamp - mod_date > 7).
- #
- # update one temp. session's mod_date -> it will be cleaned up.
- # possibility: sql-script
- # right now, the sess 104 won't be cleaned up, because its mod_date
- # is exactly current_timestamp.
- self.res = da_cleanup_temp_sess()
- da_db_commit()
- self.res = da_get_sess(104,'Y')
- self.assertEquals(len(self.res),0)
-
+ # there is no chance to test the cleanup function,
+ # because the condition for deleting is that
+ # the sess. has to be older than 7 days (current_timestamp - mod_date > 7).
+ #
+ # update one temp. session's mod_date -> it will be cleaned up.
+ # possibility: sql-script
+ # right now, the sess 104 won't be cleaned up, because its mod_date
+ # is exactly current_timestamp.
+ self.res = da_cleanup_temp_sess()
+ da_db_commit()
+ self.res = da_get_sess(104,'Y')
+ self.assertEquals(len(self.res),0)
+
def tearDown(self):
- da_db_disconnect()
-
+ da_db_disconnect()
+
if __name__ == "__main__":
support.run_tests()
More information about the Greater-commits
mailing list