# Path: osprofiler/cmd/shell.py
# class OSProfilerShell(object):
#     def __init__(self, argv):
#     def _get_base_parser(self):
#     def _append_subcommands(self, parent_parser):
#     def _no_project_and_domain_set(self, args):
# def main(args=None):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


import io
import json
import os
import sys
import ddt
from unittest import mock
from osprofiler.cmd import shell
from osprofiler import exc
from osprofiler.tests import test
                },
                "children": []
            }]
        }
        return notifications

    @mock.patch("sys.stdout", io.StringIO())
    @mock.patch("osprofiler.drivers.redis_driver.Redis.get_report")
    def test_trace_show_in_json(self, mock_get):
        notifications = self._create_mock_notifications()
        mock_get.return_value = notifications

        self.run_command(self._trace_show_cmd(format_="json"))
        self.assertEqual("%s\n" % json.dumps(notifications, indent=2,
                                             separators=(",", ": "),),
                         sys.stdout.getvalue())

    @mock.patch("sys.stdout", io.StringIO())
    @mock.patch("osprofiler.drivers.redis_driver.Redis.get_report")
    def test_trace_show_in_html(self, mock_get):
        notifications = self._create_mock_notifications()
        mock_get.return_value = notifications

        # NOTE(akurilin): to simplify assert statement, html-template should be
        # replaced.
        html_template = (
            "A long time ago in a galaxy far, far away..."
            "    some_data = $DATA"
            "It is a period of civil war. Rebel"
            "spaceships, striking from a hidden"

# Path: osprofiler/cmd/shell.py
# class OSProfilerShell(object):
#     def __init__(self, argv):
#     def _get_base_parser(self):
#     def _append_subcommands(self, parent_parser):
#     def _no_project_and_domain_set(self, args):
# def main(args=None):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
# 
# Path: osprofiler/tests/test.py
# class TestCase(testcase.TestCase):
# class FunctionalTestCase(TestCase):
#     def setUp(self):


# Path: osprofiler/tests/unit/cmd/test_shell.py
import io
import json
import os
import sys
import ddt
from unittest import mock
from osprofiler.cmd import shell
from osprofiler import exc
from osprofiler.tests import test

                },
                "children": []
            }]
        }
        return notifications

    @mock.patch("sys.stdout", io.StringIO())
    @mock.patch("osprofiler.drivers.redis_driver.Redis.get_report")
    def test_trace_show_in_json(self, mock_get):
        notifications = self._create_mock_notifications()
        mock_get.return_value = notifications

        self.run_command(self._trace_show_cmd(format_="json"))
        self.assertEqual("%s\n" % json.dumps(notifications, indent=2,
                                             separators=(",", ": "),),
                         sys.stdout.getvalue())

    @mock.patch("sys.stdout", io.StringIO())
    @mock.patch("osprofiler.drivers.redis_driver.Redis.get_report")
    def test_trace_show_in_html(self, mock_get):
        notifications = self._create_mock_notifications()
        mock_get.return_value = notifications

        # NOTE(akurilin): to simplify assert statement, html-template should be
        # replaced.
        html_template = (
            "A long time ago in a galaxy far, far away..."
            "    some_data = $DATA"
            "It is a period of civil war. Rebel"
            "spaceships, striking from a hidden"

            "base, have won their first victory"