From d1a7c313c7a62dd47f302e399e02f9aa8f1c7c78 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 2 Mar 2017 18:04:44 -0500 Subject: [PATCH] Tests: Added TI-66 test - Thanks to A M. --- AUTHORS | 1 + test/move.t | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/AUTHORS b/AUTHORS index 7e2e4717..206dae76 100644 --- a/AUTHORS +++ b/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: diff --git a/test/move.t b/test/move.t index 171b2669..fcc88ac9 100755 --- a/test/move.t +++ b/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__":