@mock.patch('requests.get', mock.MagicMock(return_value=MockResponse(LEAPSECOND_DATA_RESPONSE, 200)))
def test_update_leap_second_data():
    ait.config.leapseconds._config['filename'] = os.path.join(os.path.dirname(__file__), 'testdata', 'dmc', 'tmp_leapseconds.out')
    dmc.LeapSeconds._data = None
    dmc.LeapSeconds._update_leap_second_data()
    assert (type(dmc.LeapSeconds.leapseconds) == type([]))
    assert (dmc.LeapSeconds.leapseconds[0] == (datetime.datetime(1981, 7, 1), 1))
    assert (type(dmc.LeapSeconds.valid_date) == type(datetime.datetime.now()))
    assert os.path.isfile(ait.config.leapseconds.filename)
    os.remove(ait.config.leapseconds.filename)
@mock.patch('requests.get', mock.MagicMock(return_value=MockResponse(LEAPSECOND_DATA_RESPONSE, 200)))
def test_update_leap_second_data():
    ait.config.leapseconds._config['filename'] = os.path.join(os.path.dirname(__file__), 'testdata', 'dmc', 'tmp_leapseconds.out')
    dmc.LeapSeconds._data = None
    dmc.LeapSeconds._update_leap_second_data()
    assert (type(dmc.LeapSeconds.leapseconds) == type([]))
    assert (dmc.LeapSeconds.leapseconds[0] == (datetime.datetime(1981, 7, 1), 1))
    assert (type(dmc.LeapSeconds.valid_date) == type(datetime.datetime.now()))
    assert os.path.isfile(ait.config.leapseconds.filename)
    os.remove(ait.config.leapseconds.filename)