Exemplo n.º 1
0
def test_trange_seconds_02():
    r = trange(0, 10, seconds=1)
    assert r == range(11)
Exemplo n.º 2
0
def test_trange_hours_05():
    with set_timezone(UTC):
        r = trange(-10, 3610, hours=1)
        assert r == [0.0, 3600.0]
Exemplo n.º 3
0
def test_trange_hours_07_Alice_Springs():
    # Australia/North (UTC+09:30, never DST)
    with set_timezone(ALICE_SPRINGS):
        r = trange(-10, 7210, hours=2)
        assert r == [1800.0]
Exemplo n.º 4
0
def test_trange_hours_02():
    with set_timezone(UTC):
        r = trange(-1, 1, hours=1)
        assert r == [0.0]
Exemplo n.º 5
0
def test_trange_hours_Alice_Springs():
    # Australia/North (UTC+09:30, never DST)
    with set_timezone(ALICE_SPRINGS):
        r = trange(-3600, 3600, hours=1)
        assert r == [-1800.0, 1800.0]
Exemplo n.º 6
0
 def test_trange_hours_05(self):
     with set_timezone(UTC):
         r = trange(-10, 3610, hours=1)
         self.assertEqual(r, [0.0, 3600.0])
Exemplo n.º 7
0
def test_trange_hours_01():
    with set_timezone(UTC):
        r = trange(0, 1, hours=1)
        assert r == []
Exemplo n.º 8
0
def test_trange_hours_04():
    with set_timezone(UTC):
        r = trange(-3600, 3600, hours=1)
        assert r == [-3600.0, 0.0, 3600.0]
Exemplo n.º 9
0
def test_trange_hours_Alice_Springs():
    # Australia/North (UTC+09:30, never DST)
    with set_timezone(ALICE_SPRINGS):
        r = trange(-3600, 3600, hours=1)
        assert r == [-1800.0, 1800.0]
Exemplo n.º 10
0
def test_trange_hours_06():
    r = trange(-10, 7210, hours=1)
    assert r == [0.0, 3600.0, 7200.0]
Exemplo n.º 11
0
def test_trange_hours_07():
    r = trange(-10, 7210, hours=2)
    assert r == [0.0, 7200.0]
Exemplo n.º 12
0
def test_trange_hours_05():
    r = trange(-10, 3610, hours=1)
    assert r == [0.0, 3600.0]
Exemplo n.º 13
0
def test_trange_hours_04():
    r = trange(-3600, 3600, hours=1)
    assert r == [-3600.0, 0.0, 3600.0]
Exemplo n.º 14
0
def test_trange_hours_03():
    r = trange(0, 3600, hours=1)
    assert r == [0.0, 3600.0]
Exemplo n.º 15
0
def test_trange_milliseconds_01():
    r = trange(0, 0.1, milliseconds=1)
    assert np.allclose(np.array(r), np.linspace(0.0, 0.1, 101))
Exemplo n.º 16
0
def test_trange_hours_04_Honolulu():
    # Pacific/Honolulu (UTC-10:00, never DST)
    with set_timezone(HONOLULU):
        r = trange(-3600, 3600, hours=1)
        assert r == [-3600.0, 0.0, 3600.0]
Exemplo n.º 17
0
def test_trange_hours_02():
    r = trange(-1, 1, hours=1)
    assert r == [0.0]
Exemplo n.º 18
0
def test_trange_hours_05():
    with set_timezone(UTC):
        r = trange(-10, 3610, hours=1)
        assert r == [0.0, 3600.0]
Exemplo n.º 19
0
 def test_trange_hours_07(self):
     with set_timezone(UTC):
         r = trange(-10, 7210, hours=2)
         self.assertEqual(r, [0.0, 7200.0])
Exemplo n.º 20
0
def test_trange_hours_07():
    with set_timezone(UTC):
        r = trange(-10, 7210, hours=2)
        assert r == [0.0, 7200.0]
Exemplo n.º 21
0
def test_trange_hours_01_Honolulu():
    # Pacific/Honolulu (UTC-10:00, never DST)
    with set_timezone(HONOLULU):
        r = trange(0, 1, hours=1)
        assert r == []
Exemplo n.º 22
0
def test_trange_hours_07_Honolulu():
    # Pacific/Honolulu (UTC-10:00, never DST)
    with set_timezone(HONOLULU):
        r = trange(-10, 7210, hours=2)
        assert r == [0.0, 7200.0]
Exemplo n.º 23
0
def test_trange_hours_04():
    with set_timezone(UTC):
        r = trange(-3600, 3600, hours=1)
        assert r == [-3600.0, 0.0, 3600.0]
Exemplo n.º 24
0
 def test_trange_hours_01(self):
     with set_timezone(UTC):
         r = trange(0, 1, hours=1)
         self.assertEqual(r, [])
Exemplo n.º 25
0
def test_trange_hours_04_Honolulu():
    # Pacific/Honolulu (UTC-10:00, never DST)
    with set_timezone(HONOLULU):
        r = trange(-3600, 3600, hours=1)
        assert r == [-3600.0, 0.0, 3600.0]
Exemplo n.º 26
0
 def test_trange_hours_01_Honolulu(self):
     # Pacific/Honolulu (UTC-10:00, never DST)
     with set_timezone(HONOLULU):
         r = trange(0, 1, hours=1)
         self.assertEqual(r, [])
Exemplo n.º 27
0
def test_trange_hours_07():
    with set_timezone(UTC):
        r = trange(-10, 7210, hours=2)
        assert r == [0.0, 7200.0]
Exemplo n.º 28
0
 def test_trange_hours_02(self):
     with set_timezone(UTC):
         r = trange(-1, 1, hours=1)
         self.assertEqual(r, [0.0])
Exemplo n.º 29
0
def test_trange_hours_07_Honolulu():
    # Pacific/Honolulu (UTC-10:00, never DST)
    with set_timezone(HONOLULU):
        r = trange(-10, 7210, hours=2)
        assert r == [0.0, 7200.0]
Exemplo n.º 30
0
 def test_trange_hours_02_Alice_Springs(self):
     # Australia/North (UTC+09:30, never DST)
     with set_timezone(ALICE_SPRINGS):
         r = trange(-1, 1, hours=1)
         self.assertEqual(r, [])
Exemplo n.º 31
0
def test_trange_seconds_03():
    r = trange(0, 1.5, seconds=1)
    assert r == [0.0, 1.0]
Exemplo n.º 32
0
 def test_trange_hours_04_Honolulu(self):
     # Pacific/Honolulu (UTC-10:00, never DST)
     with set_timezone(HONOLULU):
         r = trange(-3600, 3600, hours=1)
         self.assertEqual(r, [-3600.0, 0.0, 3600.0])
Exemplo n.º 33
0
def test_trange_milliseconds_02():
    r = trange(-0.002, 0.001, milliseconds=1)
    assert np.allclose(np.array(r), np.linspace(-0.002, 0.001, 4))
Exemplo n.º 34
0
def test_trange_hours_01():
    r = trange(0, 1, hours=1)
    assert r == []