예제 #1
0
    def test_read_structs(self):
        params = Params(
            file=get_log_path('structs'),
            padding=0,
            protocol='binary',
            structs=True,
            finagle_thrift=False,  # ignored when structs
            skip_values=False,
            pretty=True,
            max_messages=0,
            debug=False,
            show_holes=False)

        output = StringIO()
        run(params, output)

        self.assertIn("'field_type': 'i32', 'value': 1", output.getvalue())
예제 #2
0
    def test_read_messages(self):
        params = Params(file=get_log_path('messages'),
                        padding=0,
                        protocol='binary',
                        structs=False,
                        finagle_thrift=False,
                        skip_values=False,
                        pretty=True,
                        max_messages=0,
                        debug=False,
                        show_holes=False)

        output = StringIO()
        run(params, output)

        self.assertIn('ping', output.getvalue())
        self.assertIn('search', output.getvalue())
        self.assertIn('reply', output.getvalue())
예제 #3
0
    def test_read_structs(self):
        params = Params(
            file=get_log_path('structs'),
            padding=0,
            protocol='binary',
            structs=True,
            finagle_thrift=False,  # ignored when structs
            skip_values=False,
            pretty=True,
            max_messages=0,
            debug=False,
            show_holes=False
        )

        output = StringIO()
        run(params, output)

        self.assertIn('Cannot divide by 0', output.getvalue())
        self.assertIn("'field_type': 'i32', 'value': 1", output.getvalue())
예제 #4
0
    def test_read_messages(self):
        params = Params(
            file=get_log_path('messages'),
            padding=0,
            protocol='binary',
            structs=False,
            finagle_thrift=False,
            skip_values=False,
            pretty=True,
            max_messages=0,
            debug=False,
            show_holes=False
        )

        output = StringIO()
        run(params, output)

        self.assertIn('ping', output.getvalue())
        self.assertIn('search', output.getvalue())
        self.assertIn('reply', output.getvalue())