def test_encode_both(self): # SETUP original = "80% of everything\nis crap" expected = "80%25 of everything%0ais crap" tracer = CodeTracer() # EXEC encoded = tracer.encode(original) decoded = tracer.decode(encoded) # VERIFY self.assertEqual(expected, encoded) self.assertEqual(original, decoded)
def test_encode_percent(self): # SETUP original = "80% of everything" expected = "80%25 of everything" tracer = CodeTracer() # EXEC encoded = tracer.encode(original) decoded = tracer.decode(encoded) # VERIFY self.assertEqual(expected, encoded) self.assertEqual(original, decoded)
def test_encode_windows_multiline(self): # SETUP original = "first\r\nsecond" expected = "first%0d%0asecond" tracer = CodeTracer() # EXEC encoded = tracer.encode(original) decoded = tracer.decode(encoded) # VERIFY self.assertEqual(expected, encoded) self.assertEqual(original, decoded)
def test_encode_single(self): # SETUP original = "single line" expected = original tracer = CodeTracer() # EXEC encoded = tracer.encode(original) decoded = tracer.decode(encoded) # VERIFY self.assertEqual(expected, encoded) self.assertEqual(original, decoded)