Example #1
0
def test_strip_non_printable_regular():
    assert strip_non_printable('hello there') == 'hello there'
Example #2
0
def test_strip_non_printable_contains_binary():
    assert strip_non_printable(ub(chr(20)) + 'my thingo' +
                               ub(chr(155))) == ('my thingo (contains binary)')
Example #3
0
def test_strip_non_printable_only_binary():
    assert strip_non_printable(ub(chr(20)) +
                               ub(chr(155))) == ('(contains binary)')
Example #4
0
def test_strip_non_printable_regular():
    assert strip_non_printable("hello there") == "hello there"
Example #5
0
 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)))
Example #6
0
def test_strip_non_printable_regular():
    assert strip_non_printable('hello there') == 'hello there'
Example #7
0
def test_strip_non_printable_only_binary():
    assert strip_non_printable(ub(chr(20)) + ub(chr(155))) == (
        '(contains binary)'
    )
Example #8
0
def test_strip_non_printable_contains_binary():
    assert strip_non_printable(ub(chr(20)) + 'my thingo' + ub(chr(155))) == (
        'my thingo (contains binary)'
    )