Exemple #1
0
    def _create_polygon(klass, poly):
        """
      Create a polygon from a room's polyline.

      Arguments:
      - poly: a dictionary representing the room's polygon informations.

      Returns:
      - a polygon object.
      """
        polygon = Polygon.from_serializable(poly)
        polygon.absolutize()
        return polygon
Exemple #2
0
   def _create_polygon(klass, poly):
      """
      Create a polygon from a room's polyline.

      Arguments:
      - poly: a dictionary representing the room's polygon informations.

      Returns:
      - a polygon object.
      """
      polygon  = Polygon.from_serializable(poly)
      polygon.absolutize()
      return polygon
 def test_polygon_from_serializable(self):
     p_dump = json.dumps(self.polygon1.to_serializable())
     p_load = json.loads(p_dump)
     pol2 = Polygon.from_serializable(p_load)
     self.assertEqual(self.polygon1, pol2)
 def test_polygon_from_serializable(self):
    p_dump = json.dumps(self.polygon1.to_serializable())
    p_load = json.loads(p_dump)
    pol2 = Polygon.from_serializable(p_load)
    self.assertEqual(self.polygon1, pol2)