added packer test
This commit is contained in:
parent
a301876ab9
commit
f32004c3a4
22
test/unit_tests/rest/packer_test.py
Normal file
22
test/unit_tests/rest/packer_test.py
Normal file
@ -0,0 +1,22 @@
|
||||
import pytest
|
||||
|
||||
from pyinfra.server.packer.packers.identity import IdentityPacker, bundle
|
||||
from pyinfra.server.packer.packers.rest import RestPacker
|
||||
from pyinfra.server.rest import pack
|
||||
from pyinfra.utils.func import lstarlift
|
||||
|
||||
|
||||
def test_identity_packer(data, metadata):
|
||||
packer = IdentityPacker()
|
||||
assert list(packer(data, metadata)) == lstarlift(bundle)(zip(data, metadata))
|
||||
|
||||
|
||||
def test_rest_packer(data, metadata):
|
||||
packer = RestPacker()
|
||||
print(metadata)
|
||||
assert list(packer(data, metadata)) == lstarlift(pack)(zip(data, metadata))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def data(input_data_items):
|
||||
return input_data_items
|
||||
Loading…
x
Reference in New Issue
Block a user