Esempio n. 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))))
Esempio n. 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))))
Esempio n. 3
0
 def test_valid_vanity(self):
     vanity = user.vanity_url(self.VALID_VANITY)
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Esempio n. 4
0
 def test_pathed_vanity(self):
     vanity = user.vanity_url('/' + self.VALID_VANITY + '/')
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Esempio n. 5
0
 def test_invalid_vanity(self):
     vanity = user.vanity_url(self.INVALID_VANITY)
     self.assertRaises(user.VanityError, lambda: vanity.id64)
Esempio n. 6
0
 def test_valid_vanity(self):
     vanity = user.vanity_url(self.VALID_VANITY)
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Esempio n. 7
0
 def test_pathed_vanity(self):
     vanity = user.vanity_url('/' + self.VALID_VANITY + '/')
     self.assertEqual(vanity.id64, ProfileTestCase.VALID_ID64)
Esempio n. 8
0
 def test_invalid_vanity(self):
     vanity = user.vanity_url(self.INVALID_VANITY)
     self.assertRaises(user.VanityError, lambda: vanity.id64)