def format_posts(self, posts): new_posts = [] for post in posts: post['date'] = int(time.mktime(post['date'].timetuple())) #post['attachments'] = '' new_posts.append(camel_case_dict(post)) return new_posts
def test_1(self): source = {'t_t': 1, 'repost_like_ratio': 80} end = camel_case_dict(source) self.assertEqual(end, {'tT': 1, 'repostLikeRatio': 80})