Beispiel #1
0
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"
Beispiel #2
0
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"
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
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
Beispiel #6
0
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
Beispiel #7
0
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
Beispiel #8
0
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
Beispiel #9
0
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
Beispiel #10
0
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
Beispiel #11
0
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
Beispiel #12
0
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
Beispiel #13
0
def test_strftimeEx_02():
    t = 0.123456
    fmt = "%(us)"
    result = strftimeEx(fmt, t)
    assert result == "456"
Beispiel #14
0
def test_strftimeEx_01():
    t = 0.123
    fmt = "%(ms)"
    result = strftimeEx(fmt, t)
    assert result == "123"
Beispiel #15
0
 def test_strftimeEx_02(self):
     t = 0.123456
     fmt = "%(us)"
     result = strftimeEx(fmt, t)
     self.assertEqual(result, "456")
Beispiel #16
0
def test_strftimeEx_02():
    t = 0.123456
    fmt = "%(us)"
    result = strftimeEx(fmt, t)
    assert result == "456"
Beispiel #17
0
def test_strftimeEx_01():
    t = 0.123
    fmt = "%(ms)"
    result = strftimeEx(fmt, t)
    assert result == "123"
Beispiel #18
0
 def test_strftimeEx_01(self):
     t = 0.123
     fmt = "%(ms)"
     result = strftimeEx(fmt, t)
     self.assertEqual(result, "123")