X-Git-Url: http://git.scottworley.com/rfc1751/blobdiff_plain/27ff981f35ca587c6a385ca8485fcb027ed62b71..1cfbde798b119a1678a7941d3702f52018f7e857:/rfc1751_test.py diff --git a/rfc1751_test.py b/rfc1751_test.py index 5fdad7f..9999dac 100644 --- a/rfc1751_test.py +++ b/rfc1751_test.py @@ -1,20 +1,35 @@ +# Copyright (c) 2024 Scott Worley +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + import unittest -from rfc1751 import rfc1751 +from rfc1751 import encode class TestRFC1751(unittest.TestCase): def testRFC1751(self) -> None: - self.assertEqual(rfc1751(0), ['A']) - self.assertEqual(rfc1751(1), ['ABE']) - self.assertEqual(rfc1751(2), ['ACE']) - self.assertEqual(rfc1751(2047), ['YOKE']) - self.assertEqual(rfc1751(2048), ['ABE', 'A']) - self.assertEqual(rfc1751(2049), ['ABE', 'ABE']) - self.assertEqual(rfc1751(2050), ['ABE', 'ACE']) + self.assertEqual(encode(0), ['A']) + self.assertEqual(encode(1), ['ABE']) + self.assertEqual(encode(2), ['ACE']) + self.assertEqual(encode(2047), ['YOKE']) + self.assertEqual(encode(2048), ['ABE', 'A']) + self.assertEqual(encode(2049), ['ABE', 'ABE']) + self.assertEqual(encode(2050), ['ABE', 'ACE']) # Note: These can get NSFW - self.assertEqual(rfc1751(2112325), ['FIRM', 'COCK']) + self.assertEqual(encode(2112325), ['FIRM', 'COCK']) if __name__ == '__main__':