<commit_before>from tornado import testing
from facebook import facebook
from tornado.ioloop import IOLoop
from tests import test_user_id, test_app_key

class GraphAPITestCase(testing.AsyncTestCase):

    def get_new_ioloop(self):
        return IOLoop.instance()

    def test_get_object(self):
        graph = facebook.GraphAPI(test_app_key)
        graph.get_object(test_user_id, callback=self.stop)
        response = self.wait()
        expected = {
            u'first_name': u'Helen', 
            u'last_name': u'Martinazzisen',
            u'middle_name': u'Amdcjhcaafjc',
            u'name': u'<NAME>',
            u'locale': u'pt_BR',
            u'gender': u'female',
            u'link': u'http://www.facebook.com/people/Helen-Amdcjhcaafjc-Martinazzisen/100004308311603',
            u'id': u'100004308311603'
        }
        self.assertDictEqual(expected, response)

    def test_invalid_key_assert_raises_graph_api_error(self):
        with self.assertRaises(facebook.GraphAPIError):
            graph = facebook.GraphAPI('notavalidkey')
            graph.get_object(test_user_id, callback=self.stop)
            self.wait()

    def test_put_object(self):
        graph = facebook.GraphAPI(test_app_key)
        graph.put_object(test_user_id, "feed", self.stop, message="Another message in the Wall")
        response = self.wait()
        import pdb; pdb.set_trace()<commit_msg>put_object method<commit_after>from tornado import testing
from facebook import facebook
from tornado.ioloop import IOLoop
from tests import test_user_id, test_app_key

class GraphAPITestCase(testing.AsyncTestCase):

    def get_new_ioloop(self):
        return IOLoop.instance()

    def test_get_object(self):
        graph = facebook.GraphAPI(test_app_key)
        graph.get_object(test_user_id, callback=self.stop)
        response = self.wait()
        expected = {
            u'first_name': u'Helen', 
            u'last_name': u'Martinazzisen',
            u'middle_name': u'Amdcjhcaafjc',
            u'name': u'<NAME>',
            u'locale': u'pt_BR',
            u'gender': u'female',
            u'link': u'http://www.facebook.com/people/Helen-Amdcjhcaafjc-Martinazzisen/100004308311603',
            u'id': u'100004308311603'
        }
        self.assertDictEqual(expected, response)

    def test_invalid_key_assert_raises_graph_api_error(self):
        with self.assertRaises(facebook.GraphAPIError):
            graph = facebook.GraphAPI('notavalidkey')
            graph.get_object(test_user_id, callback=self.stop)
            self.wait()

    def test_put_object(self):
        #putting on a test user wall is not working
        graph = facebook.GraphAPI(test_app_key)
        graph.put_object(test_user_id, "feed", self.stop, message="Another message in the Wall")
        response = self.wait()
{'fraction_non_alphanumeric': 0.10404829545454546, 'fraction_numerical': 0.02130681818181818, 'mean_word_length': 2.8641975308641974, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2813226', 'n_tokens_mistral': 958, 'n_tokens_neox': 875, 'n_words': 158}