From fad72a4382b1894c5b378482505ce5cb953915b8 Mon Sep 17 00:00:00 2001 From: digehode Date: Fri, 17 Jul 2020 18:24:44 +0100 Subject: [PATCH] Added commented-out tests for the asASCII function --- src/transcoder.py | 3 +++ tests/test_transcoder.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/transcoder.py b/src/transcoder.py index 3311e2b..f174615 100755 --- a/src/transcoder.py +++ b/src/transcoder.py @@ -1,6 +1,9 @@ #!python +""" Software and functions to convert from arbitrary strings to various representations of the individual characters """ import colored +TODO: Docstrings + def asHex(data): #Start with an empty string output="" diff --git a/tests/test_transcoder.py b/tests/test_transcoder.py index 8e4b324..f930b7d 100644 --- a/tests/test_transcoder.py +++ b/tests/test_transcoder.py @@ -8,6 +8,8 @@ import transcoder + + def test_asHex(): """ Test the 'asHex' function """ @@ -47,3 +49,17 @@ def test_asBinary(): assert transcoder.asBinary(chr(255))=="0b11111111" #Lowest byte value assert transcoder.asBinary(chr(0))=="0b0" + + + +# def test_asASCII(): +# """ Test the 'asASCII' function """ +# +# #First a simple string +# assert transcoder.asASCII("ABC")=="65 66 67" +# #An empty string +# assert transcoder.asASCII("")=="" +# #The highest byte value +# assert transcoder.asASCII(chr(255))=="255" +# #Lowest byte value +# assert transcoder.asASCII(chr(0))=="0"