def testVk(self): """Test getting profile from VK""" self.assertEqual( fetch.get_profile("fffffffffffffuuuuuuuuuuuuuuuuuuu"), fetch.get_profile("50025011"), 'get from vk not work', )
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' )
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')