def test_debug_bits_with_labels(self):
        parser = ReplayParser()

        data = StringIO()
        data.write(u'\u0001')
        data.seek(0)

        stdout = sys.stdout
        sys.stdout = StringIO()

        bits = parser._debug_bits(data, ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'])

        output = sys.stdout.getvalue()
        sys.stdout.close()
        sys.stdout = stdout

        self.assertEqual(output, """1....... = A: Not set
.0...... = B: Not set
..0..... = C: Not set
...0.... = D: Not set
....0... = E: Not set
.....0.. = F: Not set
......0. = G: Not set
.......0 = H: Not set
""")
        self.assertEqual(bits, (1, 0, 0, 0, 0, 0, 0, 0))
Beispiel #2
0
    def test_debug_bits_with_labels(self):
        parser = ReplayParser()

        data = StringIO()
        data.write(u'\u0001')
        data.seek(0)

        stdout = sys.stdout
        sys.stdout = StringIO()

        bits = parser._debug_bits(data,
                                  ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'])

        output = sys.stdout.getvalue()
        sys.stdout.close()
        sys.stdout = stdout

        self.assertEqual(
            output, """1....... = A: Not set
.0...... = B: Not set
..0..... = C: Not set
...0.... = D: Not set
....0... = E: Not set
.....0.. = F: Not set
......0. = G: Not set
.......0 = H: Not set
""")
        self.assertEqual(bits, (1, 0, 0, 0, 0, 0, 0, 0))
    def test_debug_bits(self):
        parser = ReplayParser()

        data = StringIO()
        data.write(u'\u0001')
        data.seek(0)

        stdout = sys.stdout
        sys.stdout = StringIO()

        bits = parser._debug_bits(data)

        output = sys.stdout.getvalue()
        sys.stdout.close()
        sys.stdout = stdout

        self.assertEqual(output, """1.......
.0......
..0.....
...0....
....0...
.....0..
......0.
.......0
""")
        self.assertEqual(bits, (1, 0, 0, 0, 0, 0, 0, 0))
Beispiel #4
0
    def test_debug_bits(self):
        parser = ReplayParser()

        data = StringIO()
        data.write(u'\u0001')
        data.seek(0)

        stdout = sys.stdout
        sys.stdout = StringIO()

        bits = parser._debug_bits(data)

        output = sys.stdout.getvalue()
        sys.stdout.close()
        sys.stdout = stdout

        self.assertEqual(
            output, """1.......
.0......
..0.....
...0....
....0...
.....0..
......0.
.......0
""")
        self.assertEqual(bits, (1, 0, 0, 0, 0, 0, 0, 0))