diff --git a/jmbase/jmbase/bigstring.py b/jmbase/jmbase/bigstring.py index b247baa..6198f8a 100644 --- a/jmbase/jmbase/bigstring.py +++ b/jmbase/jmbase/bigstring.py @@ -1,7 +1,7 @@ try: from cStringIO import StringIO -except ImportError: - from StringIO import StringIO +except ImportError: #pragma: no cover + from StringIO import StringIO #pragma: no cover from itertools import count from twisted.protocols import amp @@ -45,20 +45,3 @@ class BigString(amp.Argument): def fromvalue(self, value): return value - -class BigUnicode(BigString): - """ - A unicode-string amp.Argument with no 65,535 length limit. - - Each value for a key/value pair in an AMP box may not - exceed 65,535 bytes in length. So if we *really* want to - send potentially larger values, this class will implicitly - encode/decode them to/from an arbitrary additional - number of key/value pairs that are given automatic key - names by prefixing this Argument's key name to a counter. - """ - def buildvalue(self, value): - return value.decode('utf-8') - - def fromvalue(self, value): - return value.encode('utf-8') \ No newline at end of file diff --git a/jmbase/test/test_commands.py b/jmbase/test/test_commands.py index 27b08d9..9fd20e9 100644 --- a/jmbase/test/test_commands.py +++ b/jmbase/test/test_commands.py @@ -84,8 +84,10 @@ class JMTestServerProtocol(JMBaseProtocol): @JMRequestOffers.responder def on_JM_REQUEST_OFFERS(self): show_receipt("JMREQUESTOFFERS") + #build a huge orderbook to test BigString Argument + orderbook = ["aaaa" for _ in range(2**15)] d = self.callRemote(JMOffers, - orderbook=json.dumps(["This", "is", "an", "orderbook"])) + orderbook=json.dumps(orderbook)) self.defaultCallbacks(d) return {'accepted': True}