def error_check_update_running(): host_list = HostList('error_check_update_running') host = 'http://list-iptv.com' with pytest.raises(EntryNotInDatabaseError): host_list.update_running(host, True) for invalid in [[], set(), 'fat', 'reddit.com']: with pytest.raises(InvalidUrlError): host_list.update_running(invalid, True) host_list.delete()
def test_update_running(): host_list = HostList('test_update_running') host1 = 'http://list-iptv.com' host2 = 'http://ramalin.com' host3 = 'http://m3uliste.com' for host in [host1, host2, host3]: host_list.add_to_hosts(host) order = [] while host_list.find_not_running_entry() is not None: entry = host_list.find_not_running_entry() host = entry['host'] host_list.update_running(host, True) order.append(host) for host in [host1, host2, host3]: assert host_list.entry_from_host(host)['running'] is True assert order == [host1, host2, host3] host_list.delete()