Set expires should min current header

Adding missing requirements as well as adding the ability to set expires to the min value.

When an isoformat string is set to the expires_header the code will pick the min of it and the value set currently for the expires header.
Nope just the smallest
On Aug 26, 2014 1:02 PM, "Michael Milkin" <notifications@github.com> wrote:

> In savory_pie/context.py:
>
> > @@ -75,6 +76,15 @@ def set_header(self, header, value):
> >          self.headers_dict[header] = value
> >          return self.headers_dict
> >
> > +    def set_expires_header(self, new_expires):
> > +        current_expires = self.headers_dict.get('Expires', new_expires)
> > +
> > +        expires_date = min(
> > +            [current_expires, new_expires],
> > +            key=lambda expires: parser.parse(expires) if isinstance(expires, basestring) else expires
>
> I was finding that not always do I have a datetime, I could do the
> conversion one level up, but if I do this at get_headers I would need to
> have a stack of every expires known to man. no?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/RueLaLa/savory-pie/pull/146/files#r16729470>.
>