def test_init(self): """Test common construction.""" po = ProjectObject.example() self.assertTrue(isinstance(po.pose, Pose3)) self.assertTrue(isinstance(po.meshes, GltfModel)) self.assertEqual(po.meshes.num_primitive_meshes(), 1) self.assertEqual(po.meshes.num_nodes(), 1) self.assertEqual(po.meshes.num_buffers(), 1) self.assertEqual(po.meshes.num_images(), 2) self.assertTrue(isinstance(po.category, "".__class__)) self.assertTrue(isinstance(po.symmetry, ObjectSymmetry)) self.assertEqual(po.category, "chair") self.assertEqual(po.id, "1") self.assertAlmostEqual(po.score, 0.57)
def test_almost_equal(self): object1 = ProjectObject.example(id="foobar") self.assertTrue(object1.almost_equal(object1)) object2 = ProjectObject.example(id="not_foobar") self.assertFalse(object1.almost_equal(object2))