# Path: elixir_models.py
# class RetryDB(RetryOperationalError, SqliteExtDatabase):
# class ComplexEncoder(json.JSONEncoder):
# class BaseModel(Model):
#     class Meta:
# class User(BaseModel):
# class Character(BaseModel):
# class Zone(BaseModel):
# class Message(BaseModel):
# class Object(BaseModel):
# class Message(BaseModel):
# class ScriptedObject(Object):
#     def default(self, obj):
#     def exists(cls, *args, **kwargs):
#     def json_dumps(self):
#     def __repr__(self):
#     def __repr__(self):
#     def loc(self):
#     def loc(self, val):
#     def set_modified(self, date_time=None):
#     def get_objects(since=None, physical=None, limit=None, player=None, scripted=None, name=None):
# def setup(db_uri='simplemmo.sqlite', echo=False):
# 
# Path: elixir_models.py
# def setup(db_uri='simplemmo.sqlite', echo=False):
#     print "dburi:", db_uri
#     global db
#     db.init(db_uri)
#     db.connect()
#     db.create_tables([User, Character, Zone, Message, Object], True)


import unittest
import sys
from elixir_models import db, User, Character
from elixir_models import setup as elixir_models_setup
from playhouse.test_utils import test_database
from playhouse.sqlite_ext import SqliteExtDatabase

sys.path.append(".")



test_db = SqliteExtDatabase(':memory:')

class TestUser(unittest.TestCase):

    def test_init(self):
        '''Initting a User should work.'''
        tests = {'username': 'UserName',
                 'password':'Password',
                 'email': 'asdf@zxcv.sdf'}


# Path: elixir_models.py
# class RetryDB(RetryOperationalError, SqliteExtDatabase):
# class ComplexEncoder(json.JSONEncoder):
# class BaseModel(Model):
#     class Meta:
# class User(BaseModel):
# class Character(BaseModel):
# class Zone(BaseModel):
# class Message(BaseModel):
# class Object(BaseModel):
# class Message(BaseModel):
# class ScriptedObject(Object):
#     def default(self, obj):
#     def exists(cls, *args, **kwargs):
#     def json_dumps(self):
#     def __repr__(self):
#     def __repr__(self):
#     def loc(self):
#     def loc(self, val):
#     def set_modified(self, date_time=None):
#     def get_objects(since=None, physical=None, limit=None, player=None, scripted=None, name=None):
# def setup(db_uri='simplemmo.sqlite', echo=False):
# 
# Path: elixir_models.py
# def setup(db_uri='simplemmo.sqlite', echo=False):
#     print "dburi:", db_uri
#     global db
#     db.init(db_uri)
#     db.connect()
#     db.create_tables([User, Character, Zone, Message, Object], True)


# Path: tests/test_elixir_models.py
import unittest
import sys
from elixir_models import db, User, Character
from elixir_models import setup as elixir_models_setup
from playhouse.test_utils import test_database
from playhouse.sqlite_ext import SqliteExtDatabase


sys.path.append(".")



test_db = SqliteExtDatabase(':memory:')

class TestUser(unittest.TestCase):

    def test_init(self):
        '''Initting a User should work.'''
        tests = {'username': 'UserName',
                 'password':'Password',
                 'email': 'asdf@zxcv.sdf'}


        with test_database(test_db, (User, Character)):