1. Doug Hellmann
  2. wsme

Commits

Doug Hellmann  committed e3f5ab5

add tests for binary encoding and decoding

  • Participants
  • Parent commits b61ee07
  • Branches default

Comments (0)

Files changed (1)

File wsme/tests/test_types.py

View file
         assert isinstance(s, dict)
         assert s
         assert s == {'': ''}
+
+    def test_binary_to_base(self):
+        import base64
+        assert types.binary.tobasetype(None) is None
+        assert types.binary.tobasetype('abcdef') == base64.encodestring('abcdef')
+
+    def test_binary_from_base(self):
+        import base64
+        assert types.binary.frombasetype(None) is None
+        encoded = base64.encodestring('abcdef')
+        assert types.binary.frombasetype(encoded) == 'abcdef'