# Path: spec/python/db_connection.py
# TEST_DATABASE_MYSQL = 'samapper_test'
# TEST_DATABASE_SQLITE = '/tmp/sam_test.db'
# class Mocker(object):
# class Session(dict):
# class env(object):
#     def __init__(self, *args, **kwargs):
#     def __getitem__(self, k):
#     def __setitem__(self, k, v):
#     def __getattr__(self, name):
#         def receiver(*args, **kwargs):
#     def __call__(self, *args, **kwargs):
#     def clear(self):
#     def was_called(self, name, *args, **kwargs):
#     def kill(self):
#     def __init__(self, mock_input=False, login_active=None, mock_session=False, mock_render=False, lang='en'):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
# def make_timestamp(timestring):
# def unix_timestamp_to_datetime(stamp):
# def get_test_db_connection():
# def setup_datasources(db, sub_id):
# def template_sql(path, *args):
# def setup_network(db, sub_id, ds_id):
# def setup_node_extras(sub_id):
# 
# Path: sam/constants.py
# LDAP = {
#     'connection_string': config.get('LDAP', 'connection_string', default='')
# }
# def enable_local_mode():
# def init_urls():
# def find_url(target):
# def get_navbar(lang):


from spec.python import db_connection
from sam import common
from sam import constants
from datetime import datetime
import web
import sam.pages.stats
import web
import json
import time
# coding=utf-8

ds_full = db_connection.dsid_default
ds_empty = db_connection.dsid_live


def test_render():
    with db_connection.env(mock_input=True, login_active=False, mock_session=True, mock_render=True):
        p = sam.pages.stats.Stats()
        page_title = 'Stats'
        web.ctx.path = "/sam/testpage"
        dummy = p.GET()
        calls = common.renderer.calls
        assert calls[0] == ('render', ('_head', page_title,), {'lang': 'en', 'stylesheets': p.styles, 'scripts': p.scripts})

# Path: spec/python/db_connection.py
# TEST_DATABASE_MYSQL = 'samapper_test'
# TEST_DATABASE_SQLITE = '/tmp/sam_test.db'
# class Mocker(object):
# class Session(dict):
# class env(object):
#     def __init__(self, *args, **kwargs):
#     def __getitem__(self, k):
#     def __setitem__(self, k, v):
#     def __getattr__(self, name):
#         def receiver(*args, **kwargs):
#     def __call__(self, *args, **kwargs):
#     def clear(self):
#     def was_called(self, name, *args, **kwargs):
#     def kill(self):
#     def __init__(self, mock_input=False, login_active=None, mock_session=False, mock_render=False, lang='en'):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
# def make_timestamp(timestring):
# def unix_timestamp_to_datetime(stamp):
# def get_test_db_connection():
# def setup_datasources(db, sub_id):
# def template_sql(path, *args):
# def setup_network(db, sub_id, ds_id):
# def setup_node_extras(sub_id):
# 
# Path: sam/constants.py
# LDAP = {
#     'connection_string': config.get('LDAP', 'connection_string', default='')
# }
# def enable_local_mode():
# def init_urls():
# def find_url(target):
# def get_navbar(lang):


# Path: spec/python/pages/test_stats.py
from spec.python import db_connection
from sam import common
from sam import constants
from datetime import datetime
import web
import sam.pages.stats
import web
import json
import time

# coding=utf-8

ds_full = db_connection.dsid_default
ds_empty = db_connection.dsid_live


def test_render():
    with db_connection.env(mock_input=True, login_active=False, mock_session=True, mock_render=True):
        p = sam.pages.stats.Stats()
        page_title = 'Stats'
        web.ctx.path = "/sam/testpage"
        dummy = p.GET()
        calls = common.renderer.calls
        assert calls[0] == ('render', ('_head', page_title,), {'lang': 'en', 'stylesheets': p.styles, 'scripts': p.scripts})

        assert calls[1] == ('render', ('en/_header', constants.get_navbar('en'), page_title, p.page.user, constants.debug, "/sam/testpage", constants.access_control, ('version française', '/fr/sam/testpage')), {})