def test_project_export_import(self): proj = Project(os.path.join(self.tdir, 'proj1')) self._fill_project(proj.top) proj.export(destdir=self.tdir) proj.deactivate() newproj = project_from_archive(os.path.join(self.tdir, 'proj1%s' % PROJ_FILE_EXT), proj_name='proj2', dest_dir=self.tdir) self.assertEqual(newproj.path, os.path.join(self.tdir, 'proj2')) self.assertTrue(_is_valid_project_dir(proj.path)) try: newproj = project_from_archive(os.path.join( self.tdir, 'proj1%s' % PROJ_FILE_EXT), dest_dir=self.tdir) except Exception, err: self.assertTrue(str(err).endswith(' already exists'))
def test_project_export_import(self): proj = Project(os.path.join(self.tdir, 'proj1')) self._fill_project(proj.top) proj.export(destdir=self.tdir) proj.deactivate() newproj = project_from_archive(os.path.join(self.tdir, 'proj1%s' % PROJ_FILE_EXT), proj_name='proj2', dest_dir=self.tdir) self.assertEqual(newproj.path, os.path.join(self.tdir, 'proj2')) self.assertTrue(_is_valid_project_dir(proj.path)) try: newproj = project_from_archive(os.path.join(self.tdir, 'proj1%s' % PROJ_FILE_EXT), dest_dir=self.tdir) except Exception, err: self.assertTrue(str(err).endswith(' already exists'))
def test_new_project_is_valid(self): proj = Project(os.path.join(self.tdir, 'proj1')) self._fill_project(proj.top) self.assertEqual(proj.path, os.path.join(self.tdir, 'proj1')) self.assertTrue(_is_valid_project_dir(proj.path))