예제 #1
0
def test_headers_setter():
    data = {"foo": "bar"}
    data_expected = {"foo": b"bar"}

    msg = Message(b"", headers={"bar": "baz"})
    msg.headers = data

    assert msg.headers_raw == data_expected
예제 #2
0
    def test_headers_setter(self):
        data = {'foo': 'bar'}
        data_expected = {'foo': b'bar'}

        msg = Message(b'', headers={'bar': 'baz'})
        msg.headers = data

        self.assertEqual(msg.headers_raw, data_expected,
                         "%r != %r" % (msg.headers_raw, data_expected))