def test_compatibility(self): userlist = [self.VALID_ID64, user.vanity_url("windpower"), user.vanity_url("rjackson"), user.profile(self.VALID_ID64)] resolvedids = set() for u in userlist: try: sid = u.id64 except AttributeError: sid = str(u) resolvedids.add(str(sid)) self.assertEqual(resolvedids, set(map(lambda x: str(x.id64), user.profile_batch(userlist))))
def test_compatibility(self): userlist = [ self.VALID_ID64, user.vanity_url("windpower"), user.vanity_url("rjackson"), user.profile(self.VALID_ID64) ] resolvedids = set() for u in userlist: try: sid = u.id64 except AttributeError: sid = str(u) resolvedids.add(str(sid)) self.assertEqual( resolvedids, set(map(lambda x: str(x.id64), user.profile_batch(userlist)))) self.assertEqual( resolvedids, set(map(lambda x: str(x.id64), user.bans_batch(userlist))))
def test_valid_vanity(self): vanity = user.vanity_url(self.VALID_VANITY) self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
def test_pathed_vanity(self): vanity = user.vanity_url('/' + self.VALID_VANITY + '/') self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
def test_invalid_vanity(self): vanity = user.vanity_url(self.INVALID_VANITY) self.assertRaises(user.VanityError, lambda: vanity.id64)