def test_strip_non_printable_regular(): assert strip_non_printable('hello there') == 'hello there'
def test_strip_non_printable_contains_binary(): assert strip_non_printable(ub(chr(20)) + 'my thingo' + ub(chr(155))) == ('my thingo (contains binary)')
def test_strip_non_printable_only_binary(): assert strip_non_printable(ub(chr(20)) + ub(chr(155))) == ('(contains binary)')
def test_strip_non_printable_regular(): assert strip_non_printable("hello there") == "hello there"
def __repr__(self): printable_value = strip_non_printable(self.value) return ( "<{0} value={1} (oid={2}, oid_index={3}, snmp_type={4})>".format( self.__class__.__name__, urepr(printable_value), urepr(self.oid), urepr(self.oid_index), urepr(self.snmp_type)))
def test_strip_non_printable_only_binary(): assert strip_non_printable(ub(chr(20)) + ub(chr(155))) == ( '(contains binary)' )
def test_strip_non_printable_contains_binary(): assert strip_non_printable(ub(chr(20)) + 'my thingo' + ub(chr(155))) == ( 'my thingo (contains binary)' )