def METHOD_NAME(self, mock_write):
    context = FContext("foo")
    mock_write.return_value = "bar"
    mock_trans = mock.Mock()
    self.protocol.trans = mock_trans
    self.protocol.write_request_headers(context)
    mock_write.assert_called_with(context.get_request_headers())
    mock_trans.write.assert_called_with("bar")