def test_settings_wrap(self): settings = Formatting() settings.wrap = 10 try: settings.wrap = 0 except ValueError: pass else: self.fail("Expected ValueError") try: settings.wrap = 'stripe' except ValueError: pass else: self.fail("Expected ValueError") try: settings.wrap = 3.5 except ValueError: pass else: self.fail("Expected ValueError")
def test_inspect_settings_reset(self): settings = Formatting() repr1 = repr(settings) settings.wrap = 10 settings.truncate = 8 settings.round = 2 settings.width = 90 settings.margin = 4 settings.with_types = True settings.reset() repr2 = repr(settings) self.assertEqual(repr1, repr2)