# Path: bashhub/bashhub.py
# def print_version(ctx, param, value):
# def bashhub():
# def version():
# def off(is_global):
# def on(local):
# def save(command, path, pid, process_start_time, exit_status):
# def setup():
# def status():
# def help(ctx):
# def filter(command, regex):
# def update(version):
# def util():
# def update_system_info():
# def parsedate(date_string):
# def unix_time_to_epoc_millis(unix_time):
# def main():
# CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])


from bashhub.bashhub import bashhub_globals
import os
    import configparser
    import ConfigParser as configparser
# Support for Python 2 and 3
try:
except ImportError:


def test_is_valid_regex():
    invalid_regex = '[a-2]'
    valid_regex = '(filter_me|ssh)'
    assert False == bashhub_globals.is_valid_regex(invalid_regex)
    assert True == bashhub_globals.is_valid_regex(valid_regex)


def test_write_to_config_file(tmpdir):
    bashhub_globals.BH_HOME = tmpdir.mkdir('.bashhub').strpath
    bashhub_globals.write_to_config_file("access_token", 'some-auth-token')
    config = configparser.ConfigParser()
    config.read(bashhub_globals.BH_HOME + '/config')
    assert config.get('bashhub', 'access_token') == 'some-auth-token'

def test_get_bh_filter(tmpdir):
    bashhub_globals.BH_HOME = tmpdir.mkdir('.bashhub').strpath

# Path: bashhub/bashhub.py
# def print_version(ctx, param, value):
# def bashhub():
# def version():
# def off(is_global):
# def on(local):
# def save(command, path, pid, process_start_time, exit_status):
# def setup():
# def status():
# def help(ctx):
# def filter(command, regex):
# def update(version):
# def util():
# def update_system_info():
# def parsedate(date_string):
# def unix_time_to_epoc_millis(unix_time):
# def main():
# CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])


# Path: tests/test_bashhub_globals.py
from bashhub.bashhub import bashhub_globals
import os
    import configparser
    import ConfigParser as configparser

# Support for Python 2 and 3
try:
except ImportError:


def test_is_valid_regex():
    invalid_regex = '[a-2]'
    valid_regex = '(filter_me|ssh)'
    assert False == bashhub_globals.is_valid_regex(invalid_regex)
    assert True == bashhub_globals.is_valid_regex(valid_regex)


def test_write_to_config_file(tmpdir):
    bashhub_globals.BH_HOME = tmpdir.mkdir('.bashhub').strpath
    bashhub_globals.write_to_config_file("access_token", 'some-auth-token')
    config = configparser.ConfigParser()
    config.read(bashhub_globals.BH_HOME + '/config')
    assert config.get('bashhub', 'access_token') == 'some-auth-token'

def test_get_bh_filter(tmpdir):
    bashhub_globals.BH_HOME = tmpdir.mkdir('.bashhub').strpath

    bashhub_globals.write_to_config_file('filter', 'echo')