mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Tests: Added TI-66 test
- Thanks to A M.
This commit is contained in:
parent
168cc5b207
commit
d1a7c313c7
2 changed files with 22 additions and 0 deletions
1
AUTHORS
1
AUTHORS
|
@ -22,6 +22,7 @@ The following submitted code, packages or analysis, and deserve special thanks:
|
|||
Jörg Krause
|
||||
Richard Brown
|
||||
Armado Martinez
|
||||
A M
|
||||
|
||||
Thanks to the following, who submitted detailed bug reports and excellent
|
||||
suggestions:
|
||||
|
|
21
test/move.t
21
test/move.t
|
@ -108,6 +108,27 @@ class TestMove(TestCase):
|
|||
self.assertTrue('tags' in j[0])
|
||||
self.assertEqual(j[0]['tags'][0], 'foo')
|
||||
|
||||
def test_move_interval_over_another_with_adjust(self):
|
||||
"""Move an interval over another with :adjust"""
|
||||
|
||||
code, out, err = self.t("track 20170301T110000Z - 20170301T140000Z foo")
|
||||
code, out, err = self.t("track 20170301T150000Z - 20170301T160000Z foo")
|
||||
|
||||
# Move the interval.
|
||||
code, out, err = self.t("move @1 20170301T133000Z :adjust")
|
||||
# Display is in local time zone so we can't match time exactly.
|
||||
self.assertRegexpMatches(out, 'Moved @1 to 2017-03-01T\d\d:\d\d:\d\d\n')
|
||||
|
||||
# There should now be an interval starting
|
||||
# at 13:30.
|
||||
starts = [str(x['start']) for x in self.t.export()]
|
||||
self.assertIn('20170301T133000Z', starts)
|
||||
|
||||
# There should no longer be an interval ending at
|
||||
# 14:00 as that should have been adjusted.
|
||||
ends = [str(x['end']) for x in self.t.export()]
|
||||
self.assertNotIn('20170301T140000Z', ends)
|
||||
|
||||
# TODO Add :adjust tests.
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue