Exemple #1
0
def test_eq():
    shio = CyShioTime(shio_file)

    other_shio = CyShioTime(shio_file)
    assert shio == other_shio

    other_shio = CyShioTime(shio_file)
    other_shio.daylight_savings_off = True
    assert shio != other_shio

    other_shio = CyShioTime(shio_file)
    other_shio.scale_factor = 2
    assert shio != other_shio
def test_eq():
    shio = CyShioTime(shio_file)

    other_shio = CyShioTime(shio_file)
    assert shio == other_shio

    other_shio = CyShioTime(shio_file)
    other_shio.daylight_savings_off = True
    assert shio != other_shio

    other_shio = CyShioTime(shio_file)
    other_shio.scale_factor = 2
    assert shio != other_shio

    other_shio = CyShioTime(shio_file)
    yd = os.path.join(os.path.dirname(gnome.__file__), 'data', 'yeardata')
    other_shio.yeardata = yd
    assert shio != other_shio
Exemple #3
0
def test_eval_repr():
    print "in test_eval_repr: shio_file is:", shio_file
    shio = CyShioTime(shio_file)

    print "the repr is:", repr(shio)
    other_shio = eval(repr(shio))
    assert shio == other_shio

    yd = os.path.join(os.path.dirname(gnome.__file__), 'data', 'yeardata')
    shio.yeardata = yd
    other_shio = eval(repr(shio))
    assert shio == other_shio

    shio.daylight_savings_off = False
    other_shio = eval(repr(shio))
    assert shio == other_shio

    shio.scale_factor = 2
    other_shio = eval(repr(shio))
    assert shio == other_shio
Exemple #4
0
def test_scale_factor():
    shio = CyShioTime(shio_file)
    assert shio.scale_factor == 1
    shio.scale_factor = 2
    assert shio.scale_factor == 2