@@ -111,9 +111,11 @@ def test_avro_serializer_record_subject_name_strategy(load_avsc):
111111 conf = {'subject.name.strategy' :
112112 record_subject_name_strategy })
113113
114- ctx = SerializationContext ('test_subj' , MessageField .VALUE )
114+ ctx = SerializationContext ('test_subj' , MessageField .VALUE , [] )
115115 assert test_serializer ._subject_name_func (ctx ,
116116 test_serializer ._schema_name ) == 'python.test.basic'
117+ assert ctx is not None
118+ assert not ctx .headers
117119
118120
119121def test_avro_serializer_record_subject_name_strategy_primitive (load_avsc ):
@@ -127,9 +129,10 @@ def test_avro_serializer_record_subject_name_strategy_primitive(load_avsc):
127129 conf = {'subject.name.strategy' :
128130 record_subject_name_strategy })
129131
130- ctx = SerializationContext ('test_subj' , MessageField .VALUE )
132+ ctx = SerializationContext ('test_subj' , MessageField .VALUE , [( 'header1' , 'header value 1' ), ] )
131133 assert test_serializer ._subject_name_func (ctx ,
132134 test_serializer ._schema_name ) == 'int'
135+ assert ('header1' , 'header value 1' ) in ctx .headers
133136
134137
135138def test_avro_serializer_topic_record_subject_name_strategy (load_avsc ):
@@ -162,6 +165,8 @@ def test_avro_serializer_topic_record_subject_name_strategy_primitive(load_avsc)
162165 ctx = SerializationContext ('test_subj' , MessageField .VALUE )
163166 assert test_serializer ._subject_name_func (
164167 ctx , test_serializer ._schema_name ) == 'test_subj-int'
168+ assert ctx is not None
169+ assert ctx .headers is None
165170
166171
167172def test_avro_serializer_subject_name_strategy_default (load_avsc ):
0 commit comments