# Path: authserver.py
# class UserController(object):
# class RegistrationHandler(BaseHandler):
# class AuthHandler(BaseHandler):
# class LogoutHandler(BaseHandler):
# class CharacterHandler(BaseHandler):
#     def hash_password(cls, password):
#     def check_password(cls, plaintext, hashed):
#     def post(self):
#     def register_user(self, username, password, email=None):
#     def post(self):
#     def authenticate(self, username, password):
#     def set_admin(self, user):
#     def set_current_user(self, user):
#     def get(self):
#     def get(self):
#     def get_characters(self, username):
# 
# 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
# class User(BaseModel):
#     '''User contains details useful for authenticating a user for when they
#     initially log in.'''
# 
#     username = CharField(unique=True)
#     password = CharField()
#     email = CharField(null=True)
#     # Also has 'characters'
# 
#     def __repr__(self):
#         uname = self.username
#         s = "s"*(len(self.characters)-1)
#         chars = ', '.join([c.name for c in self.characters])
#         return '<User "%s" owning character%s: %s.>' % (uname, s, chars)


import unittest
import sys
import settings
from tornado.web import Application, decode_signed_value
from tornado.testing import AsyncHTTPTestCase
from mock import Mock
from authserver import PingHandler, AuthHandler, RegistrationHandler
from elixir import session
from elixir_models import metadata, setup_all, create_all
from elixir_models import User
#!/usr/bin/env python2.7



sys.path.append(".")



def set_up_db():
    '''Connects to an in-memory SQLite database,
    with the purpose of emptying it and recreating it.'''
    metadata.bind = "sqlite:///:memory:"
#     metadata.bind.echo = True
    setup_all()

# Path: authserver.py
# class UserController(object):
# class RegistrationHandler(BaseHandler):
# class AuthHandler(BaseHandler):
# class LogoutHandler(BaseHandler):
# class CharacterHandler(BaseHandler):
#     def hash_password(cls, password):
#     def check_password(cls, plaintext, hashed):
#     def post(self):
#     def register_user(self, username, password, email=None):
#     def post(self):
#     def authenticate(self, username, password):
#     def set_admin(self, user):
#     def set_current_user(self, user):
#     def get(self):
#     def get(self):
#     def get_characters(self, username):
# 
# 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
# class User(BaseModel):
#     '''User contains details useful for authenticating a user for when they
#     initially log in.'''
# 
#     username = CharField(unique=True)
#     password = CharField()
#     email = CharField(null=True)
#     # Also has 'characters'
# 
#     def __repr__(self):
#         uname = self.username
#         s = "s"*(len(self.characters)-1)
#         chars = ', '.join([c.name for c in self.characters])
#         return '<User "%s" owning character%s: %s.>' % (uname, s, chars)


# Path: tests/integration/test_authserver.py
import unittest
import sys
import settings
from tornado.web import Application, decode_signed_value
from tornado.testing import AsyncHTTPTestCase
from mock import Mock
from authserver import PingHandler, AuthHandler, RegistrationHandler
from elixir import session
from elixir_models import metadata, setup_all, create_all
from elixir_models import User

#!/usr/bin/env python2.7



sys.path.append(".")



def set_up_db():
    '''Connects to an in-memory SQLite database,
    with the purpose of emptying it and recreating it.'''
    metadata.bind = "sqlite:///:memory:"
#     metadata.bind.echo = True
    setup_all()

    create_all()