def test_strftimeEx_03(): t = 0.678910 fmt = "%(ms)" # According to the code, the number that replaces (ms) is *rounded*, # so this formt should give "679". result = strftimeEx(fmt, t) assert result == "679"
def test_strftimeEx_07(self): # Test rounding that affects the seconds. t = 7.9996 fmt = "%S %(ms_)" result = strftimeEx(fmt, t) expected = "07 999" self.assertEqual(result, expected)
def test_strftimeEx_04(self): t = 0.678910 fmt = "%(ms_).%(us)ms" # The format "%(ms_)" uses floor(). result = strftimeEx(fmt, t) expected = "678.910ms" self.assertEqual(result, expected)
def test_strftimeEx_04(): t = 0.678910 fmt = "%(ms_).%(us)ms" # The format "%(ms_)" uses floor(). result = strftimeEx(fmt, t) expected = "678.910ms" print 'result = "%s" expected = "%s"' % (result, expected) assert result == expected
def test_strftimeEx_07(): """Test rounding that affects the seconds.""" t = 7.9996 fmt = "%S %(ms_)" result = strftimeEx(fmt, t) expected = "07 999" print('result = "%s" expected = "%s"' % (result, expected)) assert result == expected
def test_strftimeEx_05(): """Test rounding that affects the seconds.""" t = 7.9999999 fmt = "%S %(ms_) %(us)" result = strftimeEx(fmt, t) expected = "08 000 000" print 'result = "%s" expected = "%s"' % (result, expected) assert result == expected
def test_strftimeEx_05(): """Test rounding that affects the seconds.""" t = 7.9999999 fmt = "%S %(ms_) %(us)" result = strftimeEx(fmt, t) expected = "08 000 000" print('result = "%s" expected = "%s"' % (result, expected)) assert result == expected
def test_strftimeEx_07(): """Test rounding that affects the seconds.""" t = 7.9996 fmt = "%S %(ms_)" result = strftimeEx(fmt, t) expected = "07 999" print 'result = "%s" expected = "%s"' % (result, expected) assert result == expected
def test_strftimeEx_04(): t = 0.678910 fmt = "%(ms_).%(us)ms" # The format "%(ms_)" uses floor(). result = strftimeEx(fmt, t) expected = "678.910ms" print('result = "%s" expected = "%s"' % (result, expected)) assert result == expected
def test_strftimeEx_04(): t = 0.678910 fmt = "%(ms).%(us)ms" # According to the code, the number that replaces (ms) is *rounded*, # so this formt should give "679.910ms". (See the next test case for the # correct way to do this.) result = strftimeEx(fmt, t) expected = "679.910ms" assert result == expected
def test_strftimeEx_02(): t = 0.123456 fmt = "%(us)" result = strftimeEx(fmt, t) assert result == "456"
def test_strftimeEx_01(): t = 0.123 fmt = "%(ms)" result = strftimeEx(fmt, t) assert result == "123"
def test_strftimeEx_02(self): t = 0.123456 fmt = "%(us)" result = strftimeEx(fmt, t) self.assertEqual(result, "456")
def test_strftimeEx_01(self): t = 0.123 fmt = "%(ms)" result = strftimeEx(fmt, t) self.assertEqual(result, "123")