def test_two_chars_83(self):
        instr = 'AA\n' * 83
        si = StringRepresentation(instr, 40, 40)
        self.assertEqual(si.get_representation()[1], 20)

        self.assertEqual(si.get_representation()[0], 20)

        self.assertEqual(len(si.get_representation()), 40)
Example #2
0
    def show_object(self, obj):
        self._obj = obj

        # String representation
        if hasattr(obj, 'get_body'):
            str_repr_inst = StringRepresentation(obj.get_body(),
                                                 self._parent.draw_area.width,
                                                 self._parent.draw_area.height)
            str_repr_dict = str_repr_inst.get_representation()
            self._parent.draw_area.set_string_representation(str_repr_dict)

        self.synchronize()
Example #3
0
    def show_object(self, obj):
        self._obj = obj

        # String representation
        if hasattr(obj, 'get_body'):
            str_repr_inst = StringRepresentation(
                obj.get_body(),
                self._parent.draw_area.width,
                self._parent.draw_area.height
            )
            str_repr_dict = str_repr_inst.get_representation()
            self._parent.draw_area.set_string_representation(str_repr_dict)

        self.synchronize()
 def test_two_chars_157(self):
     instr = 'AB\n' * 157
     si = StringRepresentation(instr, 41, 40)
     self.assertEqual(len(si.get_representation()), 41)
    def test_two_chars_40(self):
        instr = 'AA\n' * 40
        si = StringRepresentation(instr, 40, 40)
        self.assertEqual(si.get_representation()[1], 10)

        self.assertEqual(si.get_representation()[0], 10)
    def test_one_char_40(self):
        instr = 'A\n' * 40
        si = StringRepresentation(instr, 40, 40)
        self.assertEqual(si.get_representation()[1], 25)

        self.assertEqual(si.get_representation()[0], 25)