def test_yeardata(): shio = CyShioTime(shio_file) assert shio.yeardata == '' yd = os.path.join(os.path.dirname(gnome.__file__), 'data', 'yeardata') shio.yeardata = yd # shio puts a trailing slash at the end that is platform dependent # so compare the names without the platform dependent trailing slash assert shio.yeardata[:-1] == yd
def test_yeardata(): 'test default yeardata is set correctly. Also test set function.' shio = CyShioTime(shio_file) yd = os.path.join(os.path.dirname(gnome.__file__), 'data', 'yeardata') # shio puts a trailing slash at the end that is platform dependent # so compare the names without the platform dependent trailing slash assert shio.yeardata[:-1] == yd # bogus path but we just want to test that it gets set shio.yeardata = yd assert shio.yeardata[:-1] == yd
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
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