-#!/usr/bin/python2.7
-# -*- coding: iso-8859-15 -*-
-import types
+#!/usr/bin/python3.4
from sqlalchemy import schema
from sqlalchemy.engine import create_engine
from sqlalchemy.sql import select
def connect():
engine = create_engine('mysql://philipp@localhost:3306/philipp_winterrodeln_wiki?charset=utf8&use_unicode=1')
- # engine = create_engine('mysql://philipp@localhost:3306/philipp_winterrodeln_wiki?charset=utf8&use_unicode=0')
connection = engine.connect()
- transaction = connection.begin()
+ connection.begin()
return connection
assert type(page.page_restrictions) == bytes
assert type(page.page_touched) == str
-
def test_datatype_revision(self):
metadata = schema.MetaData()
trevision = mwdb.revision_table(metadata)
assert type(revision.rev_user_text) == str
assert type(revision.rev_timestamp) == str
-
def test_datatypes_text(self):
metadata = schema.MetaData()
ttext = mwdb.text_table(metadata)
assert type(text.old_flags) == str
assert text.old_flags == 'utf-8'
-
def test_datatype_user(self):
metadata = schema.MetaData()
tuser = mwdb.user_table(metadata)
assert type(user.user_email) == str
assert user.user_name == 'Philipp'
-
def test_datatype_categorylinks(self):
metadata = schema.MetaData()
tcategorylinks = mwdb.categorylinks_table(metadata)
categorylinks = connect().execute(select([tcategorylinks], tcategorylinks.c.cl_from == 609)).first()
assert type(categorylinks.cl_to) == str
assert type(categorylinks.cl_sortkey) == str
- assert categorylinks.cl_sortkey == 'ALT BÄRNBAD'
-
+ assert categorylinks.cl_sortkey == 'ALT BÄRNBAD'