# 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"])


import re
import sys
import pytest
import rvo.commands.add
import rvo.commands.list
import datetime
import rvo.config
import mongomock
from click.testing import CliRunner
from rvo import cli
from bson import ObjectId
from dateutil import parser
@pytest.fixture()
def isatty_true(monkeypatch):
    monkeypatch.setattr(rvo.utils, "isatty", True)

@pytest.fixture()
def validation_item():
    item = {
       "content" : "Content",
       "created": datetime.datetime.now(),
       "updated": datetime.datetime.now(),
       "tags": [ "mongodb", "markdown" ],
       "categories": ["notes"],
       "encrypted": False,
       "title": "My very first entry",
    }
    return item


@pytest.fixture()
def mock_datetime_today(monkeypatch):
    monkeypatch.setattr(datetime.datetime, "now", datetime(2016, 4, 11, 17, 6, 14, 121180))

@pytest.fixture(autouse=True)
def mock_normalize_element(monkeypatch):
    monkeypatch.setattr(rvo.utils, "normalize_element", normalize_element_without_regex)

# Reusable functions from within tests.
def rvo_output(options, output):
    runner = CliRunner()
    print options

# 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/conftest.py
import re
import sys
import pytest
import rvo.commands.add
import rvo.commands.list
import datetime
import rvo.config
import mongomock
from click.testing import CliRunner
from rvo import cli
from bson import ObjectId
from dateutil import parser

@pytest.fixture()
def isatty_true(monkeypatch):
    monkeypatch.setattr(rvo.utils, "isatty", True)

@pytest.fixture()
def validation_item():
    item = {
       "content" : "Content",
       "created": datetime.datetime.now(),
       "updated": datetime.datetime.now(),
       "tags": [ "mongodb", "markdown" ],
       "categories": ["notes"],
       "encrypted": False,
       "title": "My very first entry",
    }
    return item


@pytest.fixture()
def mock_datetime_today(monkeypatch):
    monkeypatch.setattr(datetime.datetime, "now", datetime(2016, 4, 11, 17, 6, 14, 121180))

@pytest.fixture(autouse=True)
def mock_normalize_element(monkeypatch):
    monkeypatch.setattr(rvo.utils, "normalize_element", normalize_element_without_regex)

# Reusable functions from within tests.
def rvo_output(options, output):
    runner = CliRunner()
    print options

    result = runner.invoke(cli=cli.cli, args=options)