def test_settings_margin(self): settings = Formatting() settings.margin = 4 try: settings.margin = 0 except ValueError: pass else: self.fail("Expected ValueError") try: settings.margin = -1 except ValueError: pass else: self.fail("Expected ValueError") try: settings.margin = '12' # no strings except ValueError: pass else: self.fail("Expected ValueError") try: settings.margin = 3.5 # no floats 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)