Division result is wrapped to int().
In py27 sys.getsizeof(str(long_string)) / 1024 returns int value but in py34 it returns float value. Due to this "if size_kb > size_limit_kb:" condition is getting true and in py34 UT "Size of 'input' is 0KB which exceeds the limit of 0KB" error is occurred. Partially-Implements: blueprint mistral-py3 Change-Id: I0c7a4bc316fcc67084d81f59cb1f6f3f9d1a8eef
This commit is contained in:
parent
f667364364
commit
cf4561142b
|
@ -184,7 +184,7 @@ def validate_long_type_length(cls, field_name, value):
|
|||
if (size_limit_kb < 0):
|
||||
return
|
||||
|
||||
size_kb = sys.getsizeof(str(value)) / 1024
|
||||
size_kb = int(sys.getsizeof(str(value)) / 1024)
|
||||
|
||||
if size_kb > size_limit_kb:
|
||||
LOG.error(
|
||||
|
|
Loading…
Reference in New Issue