def get_field_for(key, value): if key == "Twitter": return fields.TwitterProfileField(value) elif key == "Switch": return fields.SwitchProfileField(value) elif key == "DS": return fields.DSProfileField(value) elif key == "Playstation": return fields.PlaystationProfileField(value) elif key == "XBox": return fields.XBoxProfileField(value) elif key == "Ubisoft": return fields.UbisoftProfileField(value) elif key == "Origin": return fields.OriginProfileField(value) elif key == "Epic": return fields.EpicProfileField(value) elif key == "Telegram": return fields.TelegramProfileField(value) elif key == "Facebook": return fields.FacebookProfileField(value) elif key == "Tumblr": return fields.TumblrProfileField(value) elif key == "Youtube": return fields.YoutubeProfileField(value) elif key == "Twitch": return fields.TwitchProfileField(value) elif key == "DeviantArt": return fields.DeviantArtProfileField(value) elif key == "Etsy": return fields.EtsyProfileField(value) elif key == "Furaffinity": return fields.FuraffinityProfileField(value) elif key == "Mastodon": return fields.MastodonProfileField(value) elif key == "Steam": return fields.SteamProfileField(value) else: raise ValueError
def test_twitter_generate_url(self): profile_field = fields.TwitterProfileField("real_praxis") assert profile_field.url == "https://twitter.com/real_praxis"
def test_twitter_username(self): profile_field = fields.TwitterProfileField("real_praxis") assert profile_field.username == "real_praxis"
def test_profile_add_field(self): profile = prof.Profile("133750022779961344") profile.add_field("Twitter", "@real_praxis") field = fields.TwitterProfileField("@real_praxis") assert profile.fields == {'Twitter': field}