# 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 sam import constants
from spec.browser import conftest
from sam.local import en as strings
Tests:

The home page at '/' should be the map page.
The links in the navbar should all direct to real pages with matching titles.
The main pages should load in all supported languages.
All the links in the header should work:
    Home page logo link
    Main page links
    Language links (english/french)
The language switching links in the footer switch languages when clicked, but not switch pages.
"""


def at_stats_page(browser):
    return browser.current_url.endswith("/stats")


def ensure_stats_page(browser):
    if not at_stats_page(browser):
        browser.get(conftest.host + "stats")


def test_home_page(browser):
    """The home page at '/' should be the map page."""
    browser.get(conftest.host)
    assert browser.title == strings.map_title


def test_navbar_pages(browser):
    """The links in the navbar should all direct to real pages with matching titles."""

# 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/browser/test_all_pages.py
from sam import constants
from spec.browser import conftest
from sam.local import en as strings

Tests:

The home page at '/' should be the map page.
The links in the navbar should all direct to real pages with matching titles.
The main pages should load in all supported languages.
All the links in the header should work:
    Home page logo link
    Main page links
    Language links (english/french)
The language switching links in the footer switch languages when clicked, but not switch pages.
"""


def at_stats_page(browser):
    return browser.current_url.endswith("/stats")


def ensure_stats_page(browser):
    if not at_stats_page(browser):
        browser.get(conftest.host + "stats")


def test_home_page(browser):
    """The home page at '/' should be the map page."""
    browser.get(conftest.host)
    assert browser.title == strings.map_title


def test_navbar_pages(browser):
    """The links in the navbar should all direct to real pages with matching titles."""

    urls = constants.get_navbar('en')