def test_view_point_api_v1_json(self): res = self.testapp.get("/api/point/1.json", status="*") self.assertEqual(res.status_int, 200) loaded_json = json.loads(res.body) self.assertEqual(loaded_json["version"], PointAPIv1.version()) self.assertEqual(loaded_json["name"], PointAPIv1.identifier())
def test_view_point_api_v1_json(self): res = self.testapp.get('/api/point/1.json', status='*') self.assertEqual(res.status_int, 200) loaded_json = json.loads(res.body) self.assertEqual(loaded_json['version'], PointAPIv1.version()) self.assertEqual(loaded_json['name'], PointAPIv1.identifier())
def test_to_dict(self): name = PointAPIv1.identifier() description = PointAPIv1.description() version = PointAPIv1.version() the_dict = PointAPIv1.to_dict() self.assertEqual(the_dict["name"], name, msg="Name should match") self.assertEqual(the_dict["description"], description, msg="Description should match") self.assertEqual(the_dict["version"], version, msg="Version should match")
def test_to_dict(self): name = PointAPIv1.identifier() description = PointAPIv1.description() version = PointAPIv1.version() the_dict = PointAPIv1.to_dict() self.assertEqual(the_dict['name'], name, msg="Name should match") self.assertEqual(the_dict['description'], description, msg="Description should match") self.assertEqual(the_dict['version'], version, msg="Version should match")
def test_version(self): self.assertEqual(PointAPIv1.version(), 1, msg="Version should be 1")