Beispiel #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',
     )
Beispiel #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',
     )
Beispiel #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'
     )
Beispiel #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')