Mercurial > silorider
comparison tests/test_commands_populate.py @ 41:1db1890edcf5
Change populate command's 'until' argument to be exclusive and support time
The argument can now specify a time within the day, but this forces the
argument to now be exclusive. So if only a date is provided (no time),
you need to enter the next day, i.e. the first day to *not* be included.
This makes the argument effectively exclusive.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 20 Aug 2023 11:14:31 -0700 |
parents | a921cc2306bc |
children | 91dea4fe31ec |
comparison
equal
deleted
inserted
replaced
39:c5f73ebb43a5 | 41:1db1890edcf5 |
---|---|
42 | 42 |
43 def test_populate_until(cli): | 43 def test_populate_until(cli): |
44 feed = cli.createTempFeed(feed2) | 44 feed = cli.createTempFeed(feed2) |
45 cli.appendSiloConfig('test', 'print', items='name') | 45 cli.appendSiloConfig('test', 'print', items='name') |
46 cli.setFeedConfig('feed', feed) | 46 cli.setFeedConfig('feed', feed) |
47 ctx, _ = cli.run('populate', '-s', 'test', '--until', '2018-01-08') | 47 ctx, _ = cli.run('populate', '-s', 'test', '--until', '2018-01-08 9AM') |
48 assert ctx.cache.wasPosted('test', 'https://example.org/first-article') | 48 assert ctx.cache.wasPosted('test', 'https://example.org/first-article') |
49 assert ctx.cache.wasPosted('test', 'https://example.org/second-article') | 49 assert ctx.cache.wasPosted('test', 'https://example.org/second-article') |
50 assert not ctx.cache.wasPosted('test', 'https://example.org/third-article') | 50 assert not ctx.cache.wasPosted('test', 'https://example.org/third-article') |