Skip to content

Commit

Permalink
Re #8351. Amend tests to account for the additional space.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Nov 8, 2013
1 parent 46205ee commit e96a664
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_startime(self):

runstart = run.startTime()
runstartstr = str(runstart)
self.assertEquals(runstartstr, "2008-12-18T17:58:38")
self.assertEquals(runstartstr, "2008-12-18T17:58:38 ") # The space at the end is to get around an IPython bug (#8351)
self.assertTrue(isinstance(runstart, DateAndTime))

def test_endtime(self):
Expand All @@ -101,7 +101,7 @@ def test_endtime(self):

runend = run.endTime()
runendstr = str(runend)
self.assertEquals(runendstr, "2008-12-18T17:59:40")
self.assertEquals(runendstr, "2008-12-18T17:59:40 ") # The space at the end is to get around an IPython bug (#8351)
self.assertTrue(isinstance(runend, DateAndTime))

if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
class DateAndTimeTest(unittest.TestCase):

iso_str = "2008-12-18T17:58:38"
# We had to add a space to the end of the string representation to get around an IPython bug (#8351)
iso_str_plus_space = iso_str + " "

def test_construction_with_ISO_string_produces_expected_object(self):
dt = DateAndTime(self.iso_str)
self.assertEquals(self.iso_str, str(dt))
self.assertEquals(self.iso_str_plus_space, str(dt))
self.assertEquals(dt.totalNanoseconds(), 598471118000000000)

def test_construction_with_total_nano_seconds(self):
dt = DateAndTime(598471118000000000)
self.assertEquals(self.iso_str, str(dt))
self.assertEquals(self.iso_str_plus_space, str(dt))

if __name__ == "__main__":
unittest.main()
unittest.main()

0 comments on commit e96a664

Please sign in to comment.