Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_nested_list(array):
a = pikepdf.Array(array)
assert decode_encode(a) == a
def test_nested_list2(array):
assume(isinstance(array, list))
a = pikepdf.Array(array)
assert decode_encode(a) == a
def test_len_array():
assert len(Array([])) == 0
assert len(Array([3])) == 1
def test_repr_dict(self):
d = Dictionary({
'/Boolean': True,
'/Integer': 42,
'/Real': Decimal('42.42'),
'/String': String('hi'),
'/Array': Array([1, 2, 3]),
'/Operator': Operator('q'),
'/Dictionary': Dictionary({'/Color': 'Red'})
})
expected = """\
pikepdf.Dictionary({
"/Array": [ 1, 2, 3 ],
"/Boolean": True,
"/Dictionary": {
"/Color": "Red"
},
"/Integer": 42,
"/Operator": pikepdf.Operator("q"),
"/Real": Decimal('42.42'),
"/String": "hi"
})
"""
def test_list(array):
a = pikepdf.Array(array)
assert decode_encode(a) == a