def get(self): """ Gets the last updates of the requested resource. """ args = self.reqparse.parse_args() if args['resource'] != None and len(args['resource']) > 0: # Get the last post updates if args['resource'] == 'posts': result = manager.get_last_post_updates() return jsonify(posts=result) else: abort(404) else: abort(400)
def test_4_updates(self): self.assertEqual(len(manager.get_last_post_updates()), 0) manager.populate_test2() self.assertGreater(len(manager.get_last_post_updates()), 0)