Skip to content

Commit

Permalink
Added commented-out tests for the asASCII function
Browse files Browse the repository at this point in the history
  • Loading branch information
digehode committed Jul 17, 2020
1 parent 81f2859 commit fad72a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transcoder.py
Original file line number Diff line number Diff line change
@@ -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=""
Expand Down
16 changes: 16 additions & 0 deletions tests/test_transcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@





def test_asHex():
""" Test the 'asHex' function """

Expand Down Expand Up @@ -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"

0 comments on commit fad72a4

Please sign in to comment.