示例#1
0
    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))))
示例#2
0
    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))))
示例#3
0
 def test_level(self):
     profile = user.profile(self.VALID_ID64)
     self.assertGreater(profile.level, 0)
示例#4
0
 def test_weird_id(self):
     profile = user.profile(self.WEIRD_ID64)
     self.assertRaises(user.ProfileNotFoundError, lambda: profile.id64)
示例#5
0
 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)
示例#6
0
 def test_pathed_id(self):
     profile = user.profile('/' + str(self.VALID_ID64) + '/')
     self.assertEqual(profile.id64, self.VALID_ID64)
示例#7
0
 def test_invalid_id(self):
     profile = user.profile(self.INVALID_ID64)
     self.assertRaises(user.ProfileNotFoundError, lambda: profile.id64)
示例#8
0
 def test_level(self):
     profile = user.profile(self.VALID_ID64)
     self.assertGreater(profile.level, 0)
示例#9
0
 def test_weird_id(self):
     profile = user.profile(self.WEIRD_ID64)
     self.assertRaises(user.ProfileNotFoundError, lambda: profile.id64)
示例#10
0
 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)
示例#11
0
 def test_pathed_id(self):
     profile = user.profile('/' + str(self.VALID_ID64) + '/')
     self.assertEqual(profile.id64, self.VALID_ID64)
示例#12
0
 def test_invalid_id(self):
     profile = user.profile(self.INVALID_ID64)
     self.assertRaises(user.ProfileNotFoundError, lambda: profile.id64)