def test_base( self ): exp_file = Path(tempfile.mkstemp('.ma')[1]) exp_file.remove() # just keep the path alib = AnimInOutLibrary # export with without any animation fails self.failUnlessRaises(ValueError, alib.export, exp_file, iter(list())) assert not exp_file.isfile() self._assert_no_handles() # something is selected, but there is no animation nstill = nt.Node("cylinderStill") self.failUnlessRaises(ValueError, alib.export, exp_file, (nstill,) ) assert not exp_file.isfile() self._assert_no_handles() # something with keys works fine nani = nt.Node('coneAnimated') alib.export(exp_file, (nani,)) assert exp_file.isfile() self._assert_no_handles() # import from the previous file, use remapping to get the animation onto still object exp_file.remove()
def _set_export_file(self): """Set the public export file to something new and return it. The returned Path does not exist as file.""" # prepare mock type(self)._export_to_file = tempfile.mkstemp('.ma')[1] exp_file = Path(self._export_to_file) return exp_file.remove() # just keep the path