示例#1
0
 def testVk(self):
     """Test getting profile from VK"""
     self.assertEqual(
         fetch.get_profile("fffffffffffffuuuuuuuuuuuuuuuuuuu"),
         fetch.get_profile("50025011"),
         'get from vk not work',
     )
示例#2
0
 def testVk(self):
     """Test getting profile from VK"""
     self.assertEqual(
         fetch.get_profile("fffffffffffffuuuuuuuuuuuuuuuuuuu"),
         fetch.get_profile("50025011"),
         'get from vk not work',
     )
示例#3
0
 def testNetworkFetch(self):
     """Test fetching profle by url via pika"""
     self.channel.basic_publish(
         exchange='',
         routing_key=self.pika_queue,
         body=json.dumps({
             'url': 'http://vk.com/fffffffffffffuuuuuuuuuuuuuuuuuuu/',
         }),
     )
     time.sleep(2)
     profile = self.db.profiles.find_one({
         '$or': [
             {'screen_name': "fffffffffffffuuuuuuuuuuuuuuuuuuu"},
             {'uid': "fffffffffffffuuuuuuuuuuuuuuuuuuu"}
         ]
     })
     profile.pop('_id')
     self.assertEqual(profile,
         fetch.get_profile("fffffffffffffuuuuuuuuuuuuuuuuuuu"),
         'fetch from network not work'
     )
示例#4
0
 def testNetworkFetch(self):
     """Test fetching profle by url via pika"""
     self.channel.basic_publish(
         exchange='',
         routing_key=self.pika_queue,
         body=json.dumps({
             'url':
             'http://vk.com/fffffffffffffuuuuuuuuuuuuuuuuuuu/',
         }),
     )
     time.sleep(2)
     profile = self.db.profiles.find_one({
         '$or': [{
             'screen_name': "fffffffffffffuuuuuuuuuuuuuuuuuuu"
         }, {
             'uid': "fffffffffffffuuuuuuuuuuuuuuuuuuu"
         }]
     })
     profile.pop('_id')
     self.assertEqual(profile,
                      fetch.get_profile("fffffffffffffuuuuuuuuuuuuuuuuuuu"),
                      'fetch from network not work')