Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_load_codes_from_file_raises_if_dne():
if os.path.isfile(demoji.CACHEPATH):
os.remove(demoji.CACHEPATH)
with pytest.raises(IOError):
demoji._load_codes_from_file()
assert demoji.last_downloaded_timestamp() is None