def test_process_toot_saved(capfd, tmpdir): # config uses config_listed at top of this tests file p = tmpdir.mkdir("archive") # use temporary test directory config_file["archive"] = str(p) config_file["keep_pinned"] = False config_file["toots_to_keep"].append(104136090490756999) options = Namespace(archive_deleted=False) mastodon = Mocktodon() toot_dict["pinned"] = False toot = dict2obj(toot_dict) ephemetoot.process_toot(config_file, options, mastodon, 0, toot) assert capfd.readouterr().out == "💾 skipping saved toot - 104136090490756999\n"
def test_process_toot_visibility(capfd, tmpdir): # config uses config_listed at top of this tests file p = tmpdir.mkdir("archive") # use temporary test directory config_file["archive"] = str(p) config_file["keep_pinned"] = False # is true above so make false config_file["toots_to_keep"].remove(104136090490756999) # don't keep this toot config_file["visibility_to_keep"].append("testing") options = Namespace(archive_deleted=False) mastodon = Mocktodon() toot_dict["pinned"] = False # is true above so make false toot_dict["visibility"] = "testing" toot = dict2obj(toot_dict) ephemetoot.process_toot(config_file, options, mastodon, toot, 0) assert capfd.readouterr().out == "👀 skipping testing toot - 104136090490756999\n"
def test_process_toot(capfd, tmpdir, monkeypatch): # config uses config_listed at top of this tests file p = tmpdir.mkdir("archive") # use temporary test directory config_file["archive"] = str(p) config_file["keep_pinned"] = False config_file["toots_to_keep"] = [] config_file["visibility_to_keep"] = [] options = Namespace(archive_deleted=False) mastodon = Mocktodon() toot_dict["pinned"] = False toot_dict["visibility"] = "public" toot_dict["reblog"] = False toot = dict2obj(toot_dict) ephemetoot.process_toot(config_file, options, mastodon, 0, toot) assert capfd.readouterr().out == "❌ deleting toot 104136090490756999 tooted 09 May 2020\n"