1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
|
From: TANIGUCHI Takaki <takaki@debian.org>
Date: Fri, 28 Dec 2018 16:48:45 +0900
Subject: Fix package name conflicts
---
tests/test_scripts/test_pcreate.py | 106 ++++++++++++++++++-------------------
1 file changed, 53 insertions(+), 53 deletions(-)
diff --git a/tests/test_scripts/test_pcreate.py b/tests/test_scripts/test_pcreate.py
index 6ac082b..a1c0ac4 100644
--- a/tests/test_scripts/test_pcreate.py
+++ b/tests/test_scripts/test_pcreate.py
@@ -60,7 +60,7 @@ class TestPCreateCommand(unittest.TestCase):
self.assertTrue(out.count('You must provide a project name'))
def test_unknown_scaffold_name(self):
- cmd = self._makeOne('-s', 'dummyXX', 'distro')
+ cmd = self._makeOne('-s', 'dummyXX', 'distro0')
result = cmd.run()
self.assertEqual(result, 2)
out = self.out_.getvalue()
@@ -69,7 +69,7 @@ class TestPCreateCommand(unittest.TestCase):
def test_known_scaffold_single_rendered(self):
import os
- cmd = self._makeOne('-s', 'dummy', 'Distro')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.1")
@@ -77,14 +77,14 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(result, 0)
self.assertEqual(
scaffold.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), 'Distro')),
+ os.path.normpath(os.path.join(os.getcwd(), 'Distro0')),
)
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.1',
'pyramid_docs_branch': '0.1-branch',
},
@@ -94,7 +94,7 @@ class TestPCreateCommand(unittest.TestCase):
import os
cmd = self._makeOne(
- '-s', 'dummy', '--package-name', 'dummy_package', 'Distro'
+ '-s', 'dummy', '--package-name', 'dummy_package', 'Distro0'
)
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
@@ -104,12 +104,12 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(result, 0)
self.assertEqual(
scaffold.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), 'Distro')),
+ os.path.normpath(os.path.join(os.getcwd(), 'Distro0')),
)
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
+ 'project': 'Distro0',
'egg': 'dummy_package',
'package': 'dummy_package',
'pyramid_version': '0.1',
@@ -120,7 +120,7 @@ class TestPCreateCommand(unittest.TestCase):
def test_scaffold_with_hyphen_in_project_name(self):
import os
- cmd = self._makeOne('-s', 'dummy', 'Distro-')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0-')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.1")
@@ -128,14 +128,14 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(result, 0)
self.assertEqual(
scaffold.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), 'Distro-')),
+ os.path.normpath(os.path.join(os.getcwd(), 'Distro0-')),
)
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro-',
- 'egg': 'Distro_',
- 'package': 'distro_',
+ 'project': 'Distro0-',
+ 'egg': 'Distro0_',
+ 'package': 'distro0_',
'pyramid_version': '0.1',
'pyramid_docs_branch': '0.1-branch',
},
@@ -144,7 +144,7 @@ class TestPCreateCommand(unittest.TestCase):
def test_known_scaffold_absolute_path(self):
import os
- path = os.path.abspath('Distro')
+ path = os.path.abspath('Distro0')
cmd = self._makeOne('-s', 'dummy', path)
cmd.pyramid_dist = DummyDist("0.1")
scaffold = DummyScaffold('dummy')
@@ -154,14 +154,14 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(result, 0)
self.assertEqual(
scaffold.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), 'Distro')),
+ os.path.normpath(os.path.join(os.getcwd(), 'Distro0')),
)
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.1',
'pyramid_docs_branch': '0.1-branch',
},
@@ -170,7 +170,7 @@ class TestPCreateCommand(unittest.TestCase):
def test_known_scaffold_multiple_rendered(self):
import os
- cmd = self._makeOne('-s', 'dummy1', '-s', 'dummy2', 'Distro')
+ cmd = self._makeOne('-s', 'dummy1', '-s', 'dummy2', 'Distro0')
scaffold1 = DummyScaffold('dummy1')
scaffold2 = DummyScaffold('dummy2')
cmd.scaffolds = [scaffold1, scaffold2]
@@ -179,28 +179,28 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(result, 0)
self.assertEqual(
scaffold1.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), 'Distro')),
+ os.path.normpath(os.path.join(os.getcwd(), 'Distro0')),
)
self.assertEqual(
scaffold1.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.1',
'pyramid_docs_branch': '0.1-branch',
},
)
self.assertEqual(
scaffold2.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), 'Distro')),
+ os.path.normpath(os.path.join(os.getcwd(), 'Distro0')),
)
self.assertEqual(
scaffold2.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.1',
'pyramid_docs_branch': '0.1-branch',
},
@@ -209,7 +209,7 @@ class TestPCreateCommand(unittest.TestCase):
def test_known_scaffold_with_path_as_project_target_rendered(self):
import os
- cmd = self._makeOne('-s', 'dummy', '/tmp/foo/Distro/')
+ cmd = self._makeOne('-s', 'dummy', '/tmp/foo/Distro0/')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.1")
@@ -217,21 +217,21 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(result, 0)
self.assertEqual(
scaffold.output_dir,
- os.path.normpath(os.path.join(os.getcwd(), '/tmp/foo/Distro')),
+ os.path.normpath(os.path.join(os.getcwd(), '/tmp/foo/Distro0')),
)
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.1',
'pyramid_docs_branch': '0.1-branch',
},
)
def test_scaffold_with_prod_pyramid_version(self):
- cmd = self._makeOne('-s', 'dummy', 'Distro')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.2")
@@ -240,16 +240,16 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.2',
'pyramid_docs_branch': '0.2-branch',
},
)
def test_scaffold_with_prod_pyramid_long_version(self):
- cmd = self._makeOne('-s', 'dummy', 'Distro')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.2.1")
@@ -258,16 +258,16 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.2.1',
'pyramid_docs_branch': '0.2-branch',
},
)
def test_scaffold_with_prod_pyramid_unparsable_version(self):
- cmd = self._makeOne('-s', 'dummy', 'Distro')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("abc")
@@ -276,16 +276,16 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': 'abc',
'pyramid_docs_branch': 'latest',
},
)
def test_scaffold_with_dev_pyramid_version(self):
- cmd = self._makeOne('-s', 'dummy', 'Distro')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.12dev")
@@ -294,16 +294,16 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.12dev',
'pyramid_docs_branch': 'master',
},
)
def test_scaffold_with_dev_pyramid_long_version(self):
- cmd = self._makeOne('-s', 'dummy', 'Distro')
+ cmd = self._makeOne('-s', 'dummy', 'Distro0')
scaffold = DummyScaffold('dummy')
cmd.scaffolds = [scaffold]
cmd.pyramid_dist = DummyDist("0.10.1dev")
@@ -312,9 +312,9 @@ class TestPCreateCommand(unittest.TestCase):
self.assertEqual(
scaffold.vars,
{
- 'project': 'Distro',
- 'egg': 'Distro',
- 'package': 'distro',
+ 'project': 'Distro0',
+ 'egg': 'Distro0',
+ 'package': 'distro0',
'pyramid_version': '0.10.1dev',
'pyramid_docs_branch': 'master',
},
|