Translated test data to english

master
baztian 2011-01-26 13:47:58 +01:00
parent 5c0255d901
commit 525c3fa192
3 changed files with 19 additions and 18 deletions

View File

@ -1,8 +1,8 @@
create table konto ( create table Account (
"KONTO_ID" TIMESTAMP default CURRENT_TIMESTAMP not null, "ACCOUNT_ID" TIMESTAMP default CURRENT_TIMESTAMP not null,
"KONTO_NR" INTEGER not null, "ACCOUNT_NO" INTEGER not null,
"SALDO" DECIMAL default 0.0 not null, "BALANCE" DECIMAL default 0.0 not null,
"SPERRE" DECIMAL, "BLOCKING" DECIMAL,
primary key ("KONTO_ID") primary key ("ACCOUNT_ID")
); );

View File

@ -1,2 +1,2 @@
insert into Konto values ('2009-09-10 14:15:22.123456', 18, 12.4, null); insert into ACCOUNT values ('2009-09-10 14:15:22.123456', 18, 12.4, null);
insert into Konto values ('2009-09-11 14:15:22.123456', 19, 12.9, 1); insert into ACCOUNT values ('2009-09-11 14:15:22.123456', 19, 12.9, 1);

View File

@ -105,31 +105,31 @@ class IntegrationTest(TestCase):
def tearDown(self): def tearDown(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("drop table konto"); cursor.execute("drop table ACCOUNT");
self.conn.close() self.conn.close()
def test_execute_and_fetch_no_data(self): def test_execute_and_fetch_no_data(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
stmt = "select * from konto where konto_id is null" stmt = "select * from ACCOUNT where ACCOUNT_ID is null"
cursor.execute(stmt) cursor.execute(stmt)
assert [] == cursor.fetchall() assert [] == cursor.fetchall()
def test_execute_and_fetch(self): def test_execute_and_fetch(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("select * from konto") cursor.execute("select * from ACCOUNT")
result = cursor.fetchall() result = cursor.fetchall()
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None), assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None),
(u'2009-09-11 14:15:22.123456', 19, 12.9, 1)] == result (u'2009-09-11 14:15:22.123456', 19, 12.9, 1)] == result
def test_execute_and_fetch_parameter(self): def test_execute_and_fetch_parameter(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("select * from konto where konto_nr = ?", (18,)) cursor.execute("select * from ACCOUNT where ACCOUNT_NO = ?", (18,))
result = cursor.fetchall() result = cursor.fetchall()
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None)] == result assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None)] == result
def test_execute_and_fetchone(self): def test_execute_and_fetchone(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("select * from konto order by konto_nr") cursor.execute("select * from ACCOUNT order by ACCOUNT_NO")
result = cursor.fetchone() result = cursor.fetchone()
assert (u'2009-09-10 14:15:22.123456', 18, 12.4, None) == result assert (u'2009-09-10 14:15:22.123456', 18, 12.4, None) == result
cursor.close() cursor.close()
@ -139,22 +139,22 @@ class IntegrationTest(TestCase):
has been made via execute method. has been made via execute method.
""" """
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("select * from konto") cursor.execute("select * from ACCOUNT")
assert None != cursor.description assert None != cursor.description
cursor.fetchone() cursor.fetchone()
cursor.execute("delete from konto") cursor.execute("delete from ACCOUNT")
assert None == cursor.description assert None == cursor.description
def test_execute_and_fetchone_after_end(self): def test_execute_and_fetchone_after_end(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("select * from konto where konto_nr = ?", (18,)) cursor.execute("select * from ACCOUNT where ACCOUNT_NO = ?", (18,))
cursor.fetchone() cursor.fetchone()
result = cursor.fetchone() result = cursor.fetchone()
assert None is result assert None is result
def test_execute_and_fetchmany(self): def test_execute_and_fetchmany(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
cursor.execute("select * from konto order by konto_nr") cursor.execute("select * from ACCOUNT order by ACCOUNT_NO")
result = cursor.fetchmany() result = cursor.fetchmany()
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None)] == result assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None)] == result
# TODO: find out why this cursor has to be closed in order to # TODO: find out why this cursor has to be closed in order to
@ -163,7 +163,8 @@ class IntegrationTest(TestCase):
def test_executemany(self): def test_executemany(self):
cursor = self.conn.cursor() cursor = self.conn.cursor()
stmt = "insert into Konto (KONTO_ID, KONTO_NR, SALDO) values (?, ?, ?)" stmt = "insert into ACCOUNT (ACCOUNT_ID, ACCOUNT_NO, BALANCE)" \
" values (?, ?, ?)"
parms = ( parms = (
( '2009-09-11 14:15:22.123450', 20, 13.1 ), ( '2009-09-11 14:15:22.123450', 20, 13.1 ),
( '2009-09-11 14:15:22.123451', 21, 13.2 ), ( '2009-09-11 14:15:22.123451', 21, 13.2 ),