1# Test that we can find pretty-printers for enums. 2# flake8: noqa: F821 3 4import mozilla.prettyprinters 5 6 7@mozilla.prettyprinters.pretty_printer("unscoped_no_storage") 8class my_typedef(object): 9 def __init__(self, value, cache): 10 pass 11 12 def to_string(self): 13 return "unscoped_no_storage::success" 14 15 16@mozilla.prettyprinters.pretty_printer("unscoped_with_storage") 17class my_typedef(object): 18 def __init__(self, value, cache): 19 pass 20 21 def to_string(self): 22 return "unscoped_with_storage::success" 23 24 25@mozilla.prettyprinters.pretty_printer("scoped_no_storage") 26class my_typedef(object): 27 def __init__(self, value, cache): 28 pass 29 30 def to_string(self): 31 return "scoped_no_storage::success" 32 33 34@mozilla.prettyprinters.pretty_printer("scoped_with_storage") 35class my_typedef(object): 36 def __init__(self, value, cache): 37 pass 38 39 def to_string(self): 40 return "scoped_with_storage::success" 41 42 43run_fragment("enum_printers.one") 44assert_pretty("i1", "unscoped_no_storage::success") 45assert_pretty("i2", "unscoped_with_storage::success") 46assert_pretty("i3", "scoped_no_storage::success") 47assert_pretty("i4", "scoped_with_storage::success") 48