# 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
    output = ['Content appended to "Nutella, Coffee, ninja".']
    rvo_output(options,output)

def test_append_input_none():
    runner = CliRunner()
    result = runner.invoke(cli.cli, ['append', '569e5eed6815b47ce7bdb583'], input="foo\n")
    assert not result.exception
    assert result.output.strip().endswith('Content appended to "Nutella, Coffee, ninja".')

def test_append_nonexistent():
    options = ['append', '769e5eed6815b47ce7bdb583']
    rvo_err(options)

def test_append_shortid_content():
    options = ['append', '-x', 'APPEND', '2']
    output = ['Content appended to "just broke my leg".']
    rvo_output(options,output)

def test_append_shortid_content_encrypted():
    options = ['append', '-p', 'test123', '-x', 'APPEND', '5']
    output = ['Content appended to "pynacl is just greatAPPEND".']
    rvo_output(options,output)

def test_append_shortid_content_long():
    options = ['append', '--content', 'APPEND', '2']
    output = ['Content appended to "just broke my leg".']
    rvo_output(options,output)

def test_append_shortid_stdin():
    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_append.py
from conftest import rvo_output, rvo_err
from click.testing import CliRunner
from rvo import cli

    output = ['Content appended to "Nutella, Coffee, ninja".']
    rvo_output(options,output)

def test_append_input_none():
    runner = CliRunner()
    result = runner.invoke(cli.cli, ['append', '569e5eed6815b47ce7bdb583'], input="foo\n")
    assert not result.exception
    assert result.output.strip().endswith('Content appended to "Nutella, Coffee, ninja".')

def test_append_nonexistent():
    options = ['append', '769e5eed6815b47ce7bdb583']
    rvo_err(options)

def test_append_shortid_content():
    options = ['append', '-x', 'APPEND', '2']
    output = ['Content appended to "just broke my leg".']
    rvo_output(options,output)

def test_append_shortid_content_encrypted():
    options = ['append', '-p', 'test123', '-x', 'APPEND', '5']
    output = ['Content appended to "pynacl is just greatAPPEND".']
    rvo_output(options,output)

def test_append_shortid_content_long():
    options = ['append', '--content', 'APPEND', '2']
    output = ['Content appended to "just broke my leg".']
    rvo_output(options,output)

def test_append_shortid_stdin():
    runner = CliRunner()

    result = runner.invoke(cli.cli, ['append', '1'], input="foo\n")