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_level(self): profile = user.profile(self.VALID_ID64) self.assertGreater(profile.level, 0)
def test_weird_id(self): profile = user.profile(self.WEIRD_ID64) self.assertRaises(user.ProfileNotFoundError, lambda: profile.id64)
def test_valid_id(self): profile = user.profile(self.VALID_ID64) self.assertEqual(profile.id64, self.VALID_ID64) self.assertEqual(profile.id32, self.VALID_ID32)
def test_pathed_id(self): profile = user.profile('/' + str(self.VALID_ID64) + '/') self.assertEqual(profile.id64, self.VALID_ID64)
def test_invalid_id(self): profile = user.profile(self.INVALID_ID64) self.assertRaises(user.ProfileNotFoundError, lambda: profile.id64)