Fix jsonb_plpython tests on older Python versions
Rewrite one test to avoid a case where some Python versions have output format differences (Decimal('1') vs Decimal("1")).
This commit is contained in:
parent
3f44e3db72
commit
e81fc9b9db
@ -6,11 +6,10 @@ LANGUAGE plpythonu
|
|||||||
TRANSFORM FOR TYPE jsonb
|
TRANSFORM FOR TYPE jsonb
|
||||||
AS $$
|
AS $$
|
||||||
assert isinstance(val, dict)
|
assert isinstance(val, dict)
|
||||||
plpy.info(sorted(val.items()))
|
assert(val == {'a': 1, 'c': 'NULL'})
|
||||||
return len(val)
|
return len(val)
|
||||||
$$;
|
$$;
|
||||||
SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
|
SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
|
||||||
INFO: [('a', Decimal('1')), ('c', 'NULL')]
|
|
||||||
test1
|
test1
|
||||||
-------
|
-------
|
||||||
2
|
2
|
||||||
|
@ -6,7 +6,7 @@ LANGUAGE plpythonu
|
|||||||
TRANSFORM FOR TYPE jsonb
|
TRANSFORM FOR TYPE jsonb
|
||||||
AS $$
|
AS $$
|
||||||
assert isinstance(val, dict)
|
assert isinstance(val, dict)
|
||||||
plpy.info(sorted(val.items()))
|
assert(val == {'a': 1, 'c': 'NULL'})
|
||||||
return len(val)
|
return len(val)
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user