def test_goal_single(self):
        goal_dict = {
            "id": "51a4189acf12e53f81000001",
            "date": "2014-10-05",
            "points": 500,
            "targetPoints": 1000,
            "timeZoneOffset": -8
        }
        with HTTMock(MisfitHttMock('goal_single').json_http):
            goal = self.misfit.goal(object_id=goal_dict['id'])
        eq_(type(goal), MisfitGoal)
        self.assert_misfit_string(goal, goal_dict)
        eq_(goal.id, goal_dict['id'])
        eq_(goal.date, arrow.get(goal_dict['date']))
        eq_(goal.points, goal_dict['points'])
        eq_(goal.targetPoints, goal_dict['targetPoints'])
        eq_(goal.timeZoneOffset, goal_dict['timeZoneOffset'])
        self.assertAlmostEqual(goal.percent_complete(), 50)

        # Check that percent_complete is None if targetPoints is 0
        goal.targetPoints = 0
        assert goal.percent_complete() is None
Test retrieving a goal by object_id
dataset/ETHPy150Open orcasgit/python-misfit/tests/test_misfit.py/TestMisfitAPI.test_goal_single