# Path: models/db.py
# CONNECTIONS = {
#     'dev': 'postgresql://api@localhost/saas_dev',
#     # 'dev': 'mysql+pymysql://root@localhost/saas_dev?charset=utf8mb4',
#     'stage': 'postgresql://api@localhost/saas_stage',
#     'prod': 'postgresql://api@localhost/saas_prod'
# }
# ENV = os.environ.get('ENV', 'dev')
# ENGINE = sqlalchemy.create_engine(CONNECTIONS[ENV])
# FACTORY = _init()
# def _init():
# def add(instance):
# def close():
# def commit():
# def connect():
# def delete(instance):
# def flush():
# def query(entity):
# def rollback():


    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.engine.base import Engine
from sqlalchemy.orm.scoping import scoped_session
from models import db
    import sys
import os
import warnings
"""
Tests for the database module
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
try:
except ImportError:
    print("WARNING: Cannot Load builtins for py3 compatibility.", file=sys.stderr)





warnings.simplefilter("error")  # Make All warnings errors while testing.

def test_env():
    """ Default environment should be dev. """
    assert not os.environ.get('ENV')  # First confirm that there isn't an ENV set.
    assert db.ENV == 'dev'

def test_connections():
    """ The three enviornments should each have different URLs. """
    assert 'dev' in db.CONNECTIONS
    assert 'stage' in db.CONNECTIONS
    assert 'prod' in db.CONNECTIONS
    assert db.CONNECTIONS['dev'] != db.CONNECTIONS['stage']
    assert db.CONNECTIONS['dev'] != db.CONNECTIONS['prod']

# Path: models/db.py
# CONNECTIONS = {
#     'dev': 'postgresql://api@localhost/saas_dev',
#     # 'dev': 'mysql+pymysql://root@localhost/saas_dev?charset=utf8mb4',
#     'stage': 'postgresql://api@localhost/saas_stage',
#     'prod': 'postgresql://api@localhost/saas_prod'
# }
# ENV = os.environ.get('ENV', 'dev')
# ENGINE = sqlalchemy.create_engine(CONNECTIONS[ENV])
# FACTORY = _init()
# def _init():
# def add(instance):
# def close():
# def commit():
# def connect():
# def delete(instance):
# def flush():
# def query(entity):
# def rollback():


# Path: tests/models/test_db.py
    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.engine.base import Engine
from sqlalchemy.orm.scoping import scoped_session
from models import db
    import sys
import os
import warnings

"""
Tests for the database module
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
try:
except ImportError:
    print("WARNING: Cannot Load builtins for py3 compatibility.", file=sys.stderr)





warnings.simplefilter("error")  # Make All warnings errors while testing.

def test_env():
    """ Default environment should be dev. """
    assert not os.environ.get('ENV')  # First confirm that there isn't an ENV set.
    assert db.ENV == 'dev'

def test_connections():
    """ The three enviornments should each have different URLs. """
    assert 'dev' in db.CONNECTIONS
    assert 'stage' in db.CONNECTIONS
    assert 'prod' in db.CONNECTIONS
    assert db.CONNECTIONS['dev'] != db.CONNECTIONS['stage']
    assert db.CONNECTIONS['dev'] != db.CONNECTIONS['prod']

    assert db.CONNECTIONS['prod'] != db.CONNECTIONS['stage']