Exemplo n.º 1
0
    def test_view3D_stp_decompose(self):
        f=open("apps/document3D/data_test/test2.stp")
        myfile = File(f)
        new_doc_file=self.document.add_file(myfile)
        self.controller.attach_to_document(self.document.object)

        data=self.update_data(new_doc_file)

        self.assertTrue(DecomposersManager.is_decomposable(self.controller.object))
        self.post(self.base_url+"decompose/"+str(new_doc_file.id)+"/",data)
        self.assertFalse(DecomposersManager.is_decomposable(self.controller.object))
        response = self.get(self.document.object.plmobject_url+"3D/")
        self.assertEqual(len(loads(response.context["GeometryFiles"])), 5)
Exemplo n.º 2
0
    def test_is_decomposable(self):

        self.assertTrue(DecomposersManager.is_decomposable(self.controller.object))
        
        native = self.document.add_file(self.get_file("test.fcstd"))
        self.document.lock(native)
        self.assertFalse(DecomposersManager.is_decomposable(self.controller.object))
        
        self.document.unlock(native)
        self.document.lock(self.stp)
        self.assertFalse(DecomposersManager.is_decomposable(self.controller.object))

        self.controller.detach_document(self.document)
        self.controller.attach_to_document(self.ctrl2)
        self.assertFalse(DecomposersManager.is_decomposable(self.controller.object))
Exemplo n.º 3
0
    def test_is_decomposable(self):

        self.assertTrue(
            DecomposersManager.is_decomposable(self.controller.object))

        native = self.document.add_file(self.get_file("test.fcstd"))
        self.document.lock(native)
        self.assertFalse(
            DecomposersManager.is_decomposable(self.controller.object))

        self.document.unlock(native)
        self.document.lock(self.stp)
        self.assertFalse(
            DecomposersManager.is_decomposable(self.controller.object))

        self.controller.detach_document(self.document)
        self.controller.attach_to_document(self.ctrl2)
        self.assertFalse(
            DecomposersManager.is_decomposable(self.controller.object))