Merge lp:~jml/pkgme-service/remove-django-fixture into lp:pkgme-service

Proposed by Jonathan Lange
Status: Merged
Approved by: James Westby
Approved revision: 136
Merged at revision: 136
Proposed branch: lp:~jml/pkgme-service/remove-django-fixture
Merge into: lp:pkgme-service
Diff against target: 143 lines (+7/-62)
4 files modified
buildout.cfg (+1/-0)
distribute_setup.py (+1/-3)
src/djpkgme/tests/test_integration.py (+2/-56)
versions.cfg (+3/-3)
To merge this branch: bzr merge lp:~jml/pkgme-service/remove-django-fixture
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+131424@code.launchpad.net

Commit message

Remove DjangoFixture

Description of the change

Now that DjangoFixture lives in its own project (cunningly designated
lp:djangofixture), we don't need to have it in pkgme-service.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout.cfg'
2--- buildout.cfg 2012-08-23 04:14:21 +0000
3+++ buildout.cfg 2012-10-25 14:30:45 +0000
4@@ -30,6 +30,7 @@
5 recipe = z3c.recipe.scripts
6 # Test dependencies get added here
7 eggs = django-pkgme
8+ djangofixture
9 django-kombu
10 mock
11 testtools
12
13=== modified file 'distribute_setup.py'
14--- distribute_setup.py 2012-08-23 04:14:21 +0000
15+++ distribute_setup.py 2012-10-25 14:30:45 +0000
16@@ -46,9 +46,7 @@
17 args = [quote(arg) for arg in args]
18 return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
19
20-# jml's fork of distribute. Code lives at
21-# https://bitbucket.org/mumak/distribute.
22-DEFAULT_VERSION = "0.6.29DEV"
23+DEFAULT_VERSION = "0.6.30"
24 DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
25 SETUPTOOLS_FAKED_VERSION = "0.6c11"
26
27
28=== modified file 'src/djpkgme/tests/test_integration.py'
29--- src/djpkgme/tests/test_integration.py 2012-10-23 20:23:39 +0000
30+++ src/djpkgme/tests/test_integration.py 2012-10-25 14:30:45 +0000
31@@ -1,14 +1,9 @@
32-import errno
33 import json
34 import os
35 import subprocess
36 import sys
37-import time
38-from urllib2 import (
39- URLError,
40- urlopen,
41- )
42
43+from djangofixture import DjangoFixture
44 from fixtures import (
45 EnvironmentVariableFixture,
46 Fixture,
47@@ -40,7 +35,6 @@
48 get_acceptance_data_path,
49 TestCaseWithFactory,
50 )
51-from djpkgme.views import ALL_CLEAR
52 from djpkgme.tasks import get_url_for_file
53
54
55@@ -152,54 +146,6 @@
56 self.addCleanup(self.flush_db)
57
58
59-class DjangoFixture(Fixture):
60- """A simple Django service, with database.
61-
62- Essentially does 'runserver'.
63- """
64-
65- def poll_until_running(self, port):
66- url = 'http://localhost:%s/pkgme/' % (port,)
67- for i in range(100):
68- try:
69- response = urlopen(url)
70- except URLError, e:
71- error_no = getattr(e.reason, 'errno', None)
72- if error_no in (errno.ECONNREFUSED, errno.ECONNRESET):
73- time.sleep(0.05)
74- continue
75- raise
76- except IOError, e:
77- if e.errno in (errno.ECONNREFUSED, errno.ECONNRESET):
78- time.sleep(0.05)
79- continue
80- raise
81- data = response.read()
82- if data == ALL_CLEAR:
83- return
84- raise TimeoutError("Timed out waiting for %s to come up" % (url,))
85-
86- def setUp(self):
87- super(DjangoFixture, self).setUp()
88- # XXX: parallelism: Hard-code the port to run on for now. Don't know
89- # how to figure out what port it's actually listening on.
90- self.port = 8001
91- self.process = subprocess.Popen(
92- [sys.executable, get_manage_location(),
93- 'runserver', '--noreload', str(self.port)],
94- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
95- # Just terminate the process. In the future, might want to change this
96- # to a more heavyweight two-stage kill.
97- self.addCleanup(self.process.terminate)
98- self.addCleanup(
99- self.addDetail,
100- 'runserver-log',
101- Content(
102- UTF8_TEXT,
103- self.process.stdout.readlines))
104- self.poll_until_running(self.port)
105-
106-
107 def submit_local_files(service_root, file_path, metadata):
108 """Submit 'path' to pkgme-service at 'service_root' with 'metadata'.
109
110@@ -240,7 +186,7 @@
111 DjangoSettings(djpkgme=dict(pkgme_output_directory=output_dir)))
112 self.useFixture(DjangoDatabase())
113 self.useFixture(CeleryFixture())
114- self.useFixture(DjangoFixture())
115+ self.useFixture(DjangoFixture('pkgme/'))
116 settings_output = manage(['settings', '--show'])
117 self.addDetail('django-settings', text_content(settings_output))
118 def get_output_dir_contents():
119
120=== modified file 'versions.cfg'
121--- versions.cfg 2012-10-23 14:18:48 +0000
122+++ versions.cfg 2012-10-25 14:30:45 +0000
123@@ -15,9 +15,9 @@
124 celery = 2.5.0
125 Cheetah = 2.4.4
126 configglue = 1.0.1
127-# jml's fork. Code lives at https://bitbucket.org/mumak/distribute.
128-distribute = 0.6.29DEV
129+distribute = 0.6.30
130 Django = 1.3.1
131+djangofixture = 0.1
132 django-celery = 2.5.0
133 django-configglue = 0.6.1
134 django-configglue = 0.6.1
135@@ -59,7 +59,7 @@
136 South = 0.7.3
137 storm = 0.19
138 testresources = 0.2.5
139-testtools = 0.9.16
140+testtools = 0.9.21
141 treeshape = 0.2.1
142 twisted = 11.1.0
143 txpkgme = 0.2

Subscribers

People subscribed via source and target branches