# Path: rvo/cli.py
# @click.command(cls=rvoCommands, context_settings=CONTEXT_SETTINGS,
# help="""
# Manage text data on commandline
# 
# \b
# 888,8, Y8b Y888P  e88 88e
# 888 "   Y8b Y8P  d888 888b
# 888      Y8b "   Y888 888P
# 888       Y8P     "88 88"
# 
# For the sake of your own data being managed
# by you and only you!
# 
# """)
# @click.version_option(version=__version__, prog_name="rvo")
# @click.pass_context
# def cli(ctx):
#     ctx.obj = {}
#     ctx.obj['config'] = rvo.config.parse_config()
#     ctx.obj['db'] = pymongo.MongoClient(ctx.obj["config"]["uri"])


from conftest import rvo_output, rvo_err
from click.testing import CliRunner
from rvo import cli

def test_log():
    options = ['log']
    output = ["ninja", "Whoop", "Type", "Title", "Nutella", "delete", "show"]
    rvo_output(options,output)

def test_log_limit_two():
    runner = CliRunner()
    result = runner.invoke(cli.cli, ['log', '-e', '1'])
    assert not result.exception
    assert result.output.strip().endswith('569e5eed6815b47ce1bdb583')

def test_log_limit_one():
    runner = CliRunner()

# Path: rvo/cli.py
# @click.command(cls=rvoCommands, context_settings=CONTEXT_SETTINGS,
# help="""
# Manage text data on commandline
# 
# \b
# 888,8, Y8b Y888P  e88 88e
# 888 "   Y8b Y8P  d888 888b
# 888      Y8b "   Y888 888P
# 888       Y8P     "88 88"
# 
# For the sake of your own data being managed
# by you and only you!
# 
# """)
# @click.version_option(version=__version__, prog_name="rvo")
# @click.pass_context
# def cli(ctx):
#     ctx.obj = {}
#     ctx.obj['config'] = rvo.config.parse_config()
#     ctx.obj['db'] = pymongo.MongoClient(ctx.obj["config"]["uri"])


# Path: tests/test_log.py
from conftest import rvo_output, rvo_err
from click.testing import CliRunner
from rvo import cli


def test_log():
    options = ['log']
    output = ["ninja", "Whoop", "Type", "Title", "Nutella", "delete", "show"]
    rvo_output(options,output)

def test_log_limit_two():
    runner = CliRunner()
    result = runner.invoke(cli.cli, ['log', '-e', '1'])
    assert not result.exception
    assert result.output.strip().endswith('569e5eed6815b47ce1bdb583')

def test_log_limit_one():
    runner = CliRunner()

    result = runner.invoke(cli.cli, ['log', '-e', '2'])