Пример #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_valid_vanity(self):
     vanity = user.vanity_url(self.VALID_VANITY)
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Пример #4
0
 def test_pathed_vanity(self):
     vanity = user.vanity_url('/' + self.VALID_VANITY + '/')
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Пример #5
0
 def test_invalid_vanity(self):
     vanity = user.vanity_url(self.INVALID_VANITY)
     self.assertRaises(user.VanityError, lambda: vanity.id64)
Пример #6
0
 def test_valid_vanity(self):
     vanity = user.vanity_url(self.VALID_VANITY)
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Пример #7
0
 def test_pathed_vanity(self):
     vanity = user.vanity_url('/' + self.VALID_VANITY + '/')
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Пример #8
0
 def test_invalid_vanity(self):
     vanity = user.vanity_url(self.INVALID_VANITY)
     self.assertRaises(user.VanityError, lambda: vanity.id64)