class TestAttributesModel(unittest.TestCase): def setUp(self): self.model = AttributesModel() def test_attributes(self): geom = geo.Geometry.build_geometry('{"type":"LineString","coordinates":[[10.0,0.0],[10.0,10.0]]}') # unknown attributes are just ignored result = self.model.attributes(geom, includes=['ballistic']) self.assertEqual(json.loads(result), {'length': 10.0})
def setUp(self): self.model = AttributesModel()