# Path: firelet/cli.py
# def cli_args(mockargs=None):
# def give_help():    # pragma: no cover
# def help(s=None):
# def to_int(s):
# def deletion(table):
# def max_len(li):
# def prettyprint(li):
# def say(s):
# def open_fs(repodir):
# def main(mockargs=None):    # pragma: no cover
# 
# Path: firelet/flcore.py
# class DemoGitFireSet(GitFireSet):
#     """Based on GitFireSet. Provide a demo version without real network interaction.
#     The status of the simulated remote hosts is kept on files.
#     """
#     def __init__(self, repodir):
#         GitFireSet.__init__(self, repodir=repodir)
#         self.SSHConnector = MockSSHConnector
#         self.SSHConnector.repodir = repodir
#         self._demo_rulelist = defaultdict(list)


from logging import getLogger
from firelet import cli
from firelet.flcore import DemoGitFireSet
from testingutils import show
import os.path
import pytest
    def flush(self):
        self._output_history = []

    @property
    def output_history(self):
        return self._output_history

    @property
    def last(self):
        return self._output_history[-1]

    def reset_history(self):
        self._output_history = []




@pytest.fixture
def say(monkeypatch):
    monkeypatch.setattr(cli, "say", MockSay())

@pytest.fixture
def getpass(monkeypatch):
    """Mock getpass() to unit-test user creation"""
    monkeypatch.setattr(cli, "getpass", lambda x: "12345")

@pytest.fixture
def demofireset(repodir):
    "Testing is performed against the Demo FireSet"
    deb(show("Using %s as repodir" % repodir))

# Path: firelet/cli.py
# def cli_args(mockargs=None):
# def give_help():    # pragma: no cover
# def help(s=None):
# def to_int(s):
# def deletion(table):
# def max_len(li):
# def prettyprint(li):
# def say(s):
# def open_fs(repodir):
# def main(mockargs=None):    # pragma: no cover
# 
# Path: firelet/flcore.py
# class DemoGitFireSet(GitFireSet):
#     """Based on GitFireSet. Provide a demo version without real network interaction.
#     The status of the simulated remote hosts is kept on files.
#     """
#     def __init__(self, repodir):
#         GitFireSet.__init__(self, repodir=repodir)
#         self.SSHConnector = MockSSHConnector
#         self.SSHConnector.repodir = repodir
#         self._demo_rulelist = defaultdict(list)


# Path: tests/test_cli.py
from logging import getLogger
from firelet import cli
from firelet.flcore import DemoGitFireSet
from testingutils import show
import os.path
import pytest

    def flush(self):
        self._output_history = []

    @property
    def output_history(self):
        return self._output_history

    @property
    def last(self):
        return self._output_history[-1]

    def reset_history(self):
        self._output_history = []




@pytest.fixture
def say(monkeypatch):
    monkeypatch.setattr(cli, "say", MockSay())

@pytest.fixture
def getpass(monkeypatch):
    """Mock getpass() to unit-test user creation"""
    monkeypatch.setattr(cli, "getpass", lambda x: "12345")

@pytest.fixture
def demofireset(repodir):
    "Testing is performed against the Demo FireSet"
    deb(show("Using %s as repodir" % repodir))

    return DemoGitFireSet(repodir=repodir)