| 1 | # -*- mode: python; coding: utf-8 -*- |
|---|
| 2 | # :Progetto: vcpx -- Operational tests |
|---|
| 3 | # :Creato: lun 08 ago 2005 22:17:10 CEST |
|---|
| 4 | # :Autore: Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| 5 | # :Licenza: GNU General Public License |
|---|
| 6 | # |
|---|
| 7 | |
|---|
| 8 | """ |
|---|
| 9 | [DEFAULT] |
|---|
| 10 | dont-refill-changelogs = False |
|---|
| 11 | target-kind = hg |
|---|
| 12 | target-module = None |
|---|
| 13 | source-repository = /home/lele/WiP/cvsync |
|---|
| 14 | encoding = None |
|---|
| 15 | target-repository = None |
|---|
| 16 | use-svn-propset = False |
|---|
| 17 | source-module = None |
|---|
| 18 | update = True |
|---|
| 19 | source-kind = darcs |
|---|
| 20 | subdir = . |
|---|
| 21 | debug = True |
|---|
| 22 | remove-first-log-line = False |
|---|
| 23 | patch-name-format = None |
|---|
| 24 | verbose = True |
|---|
| 25 | state-file = tailor.state |
|---|
| 26 | start-revision = Almost arbitrarily tagging this as version 0.8 |
|---|
| 27 | |
|---|
| 28 | [darcs2bzr] |
|---|
| 29 | target = bzr:tailor |
|---|
| 30 | root-directory = /tmp/tailor-tests/darcs2bzr |
|---|
| 31 | source = darcs:tailor |
|---|
| 32 | |
|---|
| 33 | [darcs2cdv] |
|---|
| 34 | target = cdv:tailor |
|---|
| 35 | root-directory = /tmp/tailor-tests/darcs2cdv |
|---|
| 36 | source = darcs:tailor |
|---|
| 37 | |
|---|
| 38 | [darcs2hg] |
|---|
| 39 | target = hg:tailor |
|---|
| 40 | root-directory = /tmp/tailor-tests/darcs2hg |
|---|
| 41 | source = darcs:tailor |
|---|
| 42 | |
|---|
| 43 | [darcs2svn] |
|---|
| 44 | target = svn:tailor |
|---|
| 45 | root-directory = /tmp/tailor-tests/darcs2svn |
|---|
| 46 | source = darcs:tailor |
|---|
| 47 | |
|---|
| 48 | [svn2darcs] |
|---|
| 49 | target = darcs:svntailor |
|---|
| 50 | root-directory = /tmp/tailor-tests/svn2darcs |
|---|
| 51 | source = svn:tailor |
|---|
| 52 | start-revision = 1 |
|---|
| 53 | |
|---|
| 54 | [darcs:tailor] |
|---|
| 55 | repository = ~/WiP/cvsync |
|---|
| 56 | |
|---|
| 57 | [bzr:tailor] |
|---|
| 58 | bzr-command = /opt/src/bzr.dev/bzr |
|---|
| 59 | |
|---|
| 60 | [cdv:tailor] |
|---|
| 61 | |
|---|
| 62 | [hg:tailor] |
|---|
| 63 | |
|---|
| 64 | [svn:tailor] |
|---|
| 65 | repository = file:///tmp/tailor-tests/svnrepo |
|---|
| 66 | module = tailor |
|---|
| 67 | """ |
|---|
| 68 | |
|---|
| 69 | from unittest import TestCase, TestSuite |
|---|
| 70 | from cStringIO import StringIO |
|---|
| 71 | from vcpx.config import Config |
|---|
| 72 | from vcpx.tailor import Tailorizer |
|---|
| 73 | |
|---|
| 74 | class BootstrapOptions: |
|---|
| 75 | bootstrap = True |
|---|
| 76 | |
|---|
| 77 | class UpdateOptions: |
|---|
| 78 | bootstrap = False |
|---|
| 79 | |
|---|
| 80 | class TailorTest(TestCase): |
|---|
| 81 | |
|---|
| 82 | def setUp(self): |
|---|
| 83 | from os import mkdir |
|---|
| 84 | from os.path import exists |
|---|
| 85 | from atexit import register |
|---|
| 86 | from shutil import rmtree |
|---|
| 87 | |
|---|
| 88 | self.config = Config(StringIO(__doc__), {}) |
|---|
| 89 | if not exists('/tmp/tailor-tests'): |
|---|
| 90 | mkdir('/tmp/tailor-tests') |
|---|
| 91 | register(rmtree, '/tmp/tailor-tests') |
|---|
| 92 | |
|---|
| 93 | def testDarcsToBazaarngBootstrap(self): |
|---|
| 94 | "Test darcs to BazaarNG bootstrap" |
|---|
| 95 | |
|---|
| 96 | project = self.config['darcs2bzr'] |
|---|
| 97 | tailorizer = Tailorizer(project) |
|---|
| 98 | tailorizer(BootstrapOptions()) |
|---|
| 99 | |
|---|
| 100 | def testDarcsToBazaarngUpdate(self): |
|---|
| 101 | "Test darcs to BazaarNG update" |
|---|
| 102 | |
|---|
| 103 | project = self.config['darcs2bzr'] |
|---|
| 104 | tailorizer = Tailorizer(project) |
|---|
| 105 | tailorizer(UpdateOptions()) |
|---|
| 106 | |
|---|
| 107 | def testDarcsToMercurialBootstrap(self): |
|---|
| 108 | "Test darcs to mercurial bootstrap" |
|---|
| 109 | |
|---|
| 110 | project = self.config['darcs2hg'] |
|---|
| 111 | tailorizer = Tailorizer(project) |
|---|
| 112 | tailorizer(BootstrapOptions()) |
|---|
| 113 | |
|---|
| 114 | def testDarcsToMercurialUpdate(self): |
|---|
| 115 | "Test darcs to mercurial update" |
|---|
| 116 | |
|---|
| 117 | project = self.config['darcs2hg'] |
|---|
| 118 | tailorizer = Tailorizer(project) |
|---|
| 119 | tailorizer(UpdateOptions()) |
|---|
| 120 | |
|---|
| 121 | def testDarcsToCodevilleBootstrap(self): |
|---|
| 122 | "Test darcs to codeville bootstrap" |
|---|
| 123 | |
|---|
| 124 | project = self.config['darcs2cdv'] |
|---|
| 125 | tailorizer = Tailorizer(project) |
|---|
| 126 | tailorizer(BootstrapOptions()) |
|---|
| 127 | |
|---|
| 128 | def testDarcsToCodevilleUpdate(self): |
|---|
| 129 | "Test darcs to codeville update" |
|---|
| 130 | |
|---|
| 131 | project = self.config['darcs2cdv'] |
|---|
| 132 | tailorizer = Tailorizer(project) |
|---|
| 133 | tailorizer(UpdateOptions()) |
|---|
| 134 | |
|---|
| 135 | def testDarcsToSubversionBootstrap(self): |
|---|
| 136 | "Test darcs to subversion bootstrap" |
|---|
| 137 | |
|---|
| 138 | project = self.config['darcs2svn'] |
|---|
| 139 | tailorizer = Tailorizer(project) |
|---|
| 140 | tailorizer(BootstrapOptions()) |
|---|
| 141 | |
|---|
| 142 | def testDarcsToSubversionUpdate(self): |
|---|
| 143 | "Test darcs to subversion update" |
|---|
| 144 | |
|---|
| 145 | project = self.config['darcs2svn'] |
|---|
| 146 | tailorizer = Tailorizer(project) |
|---|
| 147 | tailorizer(UpdateOptions()) |
|---|
| 148 | |
|---|
| 149 | ## The other way |
|---|
| 150 | |
|---|
| 151 | def testSubversionToDarcsBootstrap(self): |
|---|
| 152 | "Test reversed darcs to subversion bootstrap" |
|---|
| 153 | |
|---|
| 154 | project = self.config['svn2darcs'] |
|---|
| 155 | tailorizer = Tailorizer(project) |
|---|
| 156 | tailorizer(BootstrapOptions()) |
|---|
| 157 | |
|---|
| 158 | def testSubversionToDarcsUpdate(self): |
|---|
| 159 | "Test reversed darcs to subversion update" |
|---|
| 160 | |
|---|
| 161 | project = self.config['svn2darcs'] |
|---|
| 162 | tailorizer = Tailorizer(project) |
|---|
| 163 | tailorizer(UpdateOptions()) |
|---|
| 164 | |
|---|