Diff of /examples/web_framework/test.py [727d4a] .. [efe1d1] Maximize Restore

  Switch to unified view

a/examples/web_framework/test.py b/examples/web_framework/test.py
...
...
19
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
# THE SOFTWARE.
22
# THE SOFTWARE.
23
23
24
import MySQLdb as db
25
from pyke import test
24
from pyke import test
26
from examples.sqlgen import load_mysql_schema
25
from examples.sqlgen import load_mysql_schema
27
26
28
def init():
27
def init():
29
    test.init(('.', '../sqlgen'))
28
    test.init(('.', '../sqlgen'))
30
29
31
def init_fn(engine):
30
def init_fn(engine):
32
    global Db_connection, Db_cursor
31
    global Db_connection, Db_cursor
32
    import MySQLdb as db
33
    Db_connection = db.connect(user="movie_user", passwd="user_pw",
33
    Db_connection = db.connect(user="movie_user", passwd="user_pw",
34
                               db="movie_db")
34
                               db="movie_db")
35
    Db_cursor = Db_connection.cursor()
35
    Db_cursor = Db_connection.cursor()
36
    load_mysql_schema.load_schema(engine, Db_connection)
36
    load_mysql_schema.load_schema(engine, Db_connection)
37
    engine.add_universal_fact('request', 'request_method', ('GET',))
37
    engine.add_universal_fact('request', 'request_method', ('GET',))