-
Notifications
You must be signed in to change notification settings - Fork 6
WIP: get expected date of next pkg-update #156
base: master
Are you sure you want to change the base?
Conversation
408c798
to
7e859c5
Compare
TODO:
|
'http://purl.org/cld/freq/annual': timedelta(days=365), # noqa | ||
'http://purl.org/cld/freq/biennial': timedelta(days=730), # noqa | ||
'http://purl.org/cld/freq/triennial': timedelta(days=1095), # noqa | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't need this, get rid of it ;)
self.assertEquals(None, helpers.get_expected_update(modified_set, period_irregular)) #noqa | ||
self.assertEquals(None, helpers.get_expected_update(modified_set, period_continuous)) #noqa | ||
self.assertEquals(None, helpers.get_expected_update(modified_set, period_empty)) #noqa | ||
self.assertEquals(None, helpers.get_expected_update(modified_set, period_invalid)) #noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you test for None
, you should use assertIsNone
'http://purl.org/cld/freq/semiannual': timedelta(days=183), # noqa | ||
'http://purl.org/cld/freq/annual': timedelta(days=365), # noqa | ||
'http://purl.org/cld/freq/biennial': timedelta(days=730), # noqa | ||
'http://purl.org/cld/freq/triennial': timedelta(days=1095), # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quickly looked for alternatives to timedelta and found dateutil.relativedelta, which offers a more precise solution to our problem. E.g. the monthly delta is now set to 30 days, while we actually want 1 month (ranging from 28-31 days). Maybe check this example: https://stackoverflow.com/questions/546321/how-do-i-calculate-the-date-six-months-from-the-current-date-using-the-datetime/4406260#4406260
91469db
to
bd9c830
Compare
bd9c830
to
5b1376f
Compare
No description provided.