Ejemplo n.º 1
0
 def test_parse_vertex(self):
   """Tests vertex coordinate and color parsing."""
   # Vertex 3D coordinates with RGBA color.
   vertex_data = [-0.249245, 1.119303, 0.3095566, 60, 253, 32, 255]
   coords, colors = demo_utils._parse_vertex(' '.join(map(str, vertex_data)))
   self.assertListEqual(coords, vertex_data[:3])
   self.assertListEqual(colors, vertex_data[3:6])
Ejemplo n.º 2
0
 def test_prase_vertex_expects_colors(self):
     """Tests that method will throw error if color is not poresent."""
     with self.assertRaisesRegexp(
             ValueError, "PLY file must contain vertices with colors"):
         demo_utils._parse_vertex("1 2 3")