def tailorize(self, project): "The actual test" tailorizer = Tailorizer(project, self.config) self.assert_(not tailorizer.exists(), "For test purposes, better start from scratch!") tailorizer() self.assertEqual(self.diffWhenPossible(tailorizer), "")
def run_tailor(self, assert_function=None): test_name = self.test_name for vcs in self.target_vcs: subdir = self.shared_basedirs and '#' or 'subdir = %s' % vcs test_dir = join(self.test_dir, vcs) config = Config(StringIO(self.CONFIG % vars()), {}) project = Tailorizer(test_name, config) project.workingDir().source.changesets = self.source_changesets project() if assert_function is not None: assert_function(project, vcs)
def testConfiguration(self): "Test basic configuration" p = Tailorizer('darcs2svn', self.config) self.assertEqual(p.source.subdir, 'darcside') self.assertEqual(p.rootdir, '%s/darcs2svn' % self.TESTDIR) self.assertEqual(p.source.repository, self.tailor_repo) self.assertEqual(p.target.repository, 'file://%s/svnrepo' % self.TESTDIR) self.assertEqual(p.state_file.filename, '%s/darcs2svn/tailor.state' % self.TESTDIR) tailorizer = Tailorizer('cvs2darcs', self.config) self.assertEqual(tailorizer.subdir, 'pxlib') self.assertEqual(tailorizer.source.subdir, 'pxlib')
def testCvsReappearedDirectoryToSubversion(self): """Test that we can handle resurrected cvs directory to svn.""" from vcpx.tests import DEBUG t = Tailorizer("svnresurdirtest", self.config) t() svnls = ExternalCommand(nolog=not DEBUG, command=['svn', 'ls']) manifest = svnls.execute('file://%s/cvsresurdirtest.svnrepo/test/bar' % self.TESTDIR, stdout=PIPE)[0] self.assertEqual(manifest.read(), "again\n")
def testCvsConvertDirectoryAddToSubversion(self): """Test that we can handle directory adds in the cvs module to svn.""" t = Tailorizer("svndirtest", self.config) t()
def testCvsConvertDirectoryAddToDarcs(self): """Test that we can handle directory adds in the cvs module to darcs.""" t = Tailorizer("darcsdirtest", self.config) t()
def testCvspsConvertDirectoryAddToBazaar(self): """Test that we can handle directory adds in the cvsps module to bzr.""" t = Tailorizer("cvspsdirtest", self.config) t()