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
def test_download():
assert demoji.download_codes() is None
assert type(demoji._EMOJI_PAT) == type(re.compile("")) # noqa
assert isinstance(demoji._CODE_TO_DESC, dict)
assert os.path.isfile(demoji.CACHEPATH)