MCPcopy
hub / github.com/benoitc/gunicorn / test_single_var

Method test_single_var

tests/test_uwsgi.py:65–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

63 assert packet == b'\x00\x00\x00\x00' # modifier1=0, size=0, modifier2=0
64
65 def test_single_var(self):
66 packet = make_uwsgi_packet({'KEY': 'val'})
67 # Header: modifier1(0) + size(10 in LE) + modifier2(0)
68 # Var: key_size(3 in LE) + 'KEY' + val_size(3 in LE) + 'val'
69 # Size = 2 + 3 + 2 + 3 = 10 bytes
70 expected_header = b'\x00\x0a\x00\x00'
71 expected_var = b'\x03\x00KEY\x03\x00val'
72 assert packet == expected_header + expected_var
73
74 def test_multiple_vars(self):
75 packet = make_uwsgi_packet({'A': '1', 'B': '2'})

Callers

nothing calls this directly

Calls 1

make_uwsgi_packetFunction · 0.85

Tested by

no test coverage detected