Redo boolean value encoding.

Move the code for encoding boolean values to LDAP boolean syntax from the
Parameter class to the Encoder class, where the rest of LDAP encoding takes
place. Remove encoding code from the Parameter class altogether, as all LDAP
encoding should be done in the Encoder class.
This commit is contained in:
Jan Cholasta
2012-05-04 10:34:00 -04:00
committed by Martin Kosek
parent abef5e8c02
commit d9d1967989
7 changed files with 10 additions and 70 deletions

View File

@@ -49,7 +49,7 @@ class test_Encoder(ClassChecker):
assert_equal(o.encode('ahoj'), 'ahoj'.encode(encode_to))
assert_equal(o.encode(_test_str_d), _test_str_e)
# bool, float, int, long
assert_equal(o.encode(True), str(True).encode(encode_to))
assert_equal(o.encode(True), 'TRUE'.encode(encode_to))
assert_equal(o.encode(1.01), str(1.01).encode(encode_to))
assert_equal(o.encode(1000), str(1000).encode(encode_to))
assert_equal(o.encode(long(1)), str(long(1)).encode(encode_to))