Merge lp:~leonardr/launchpadlib/edge-fakery-for-maverick into lp:launchpadlib

Proposed by Leonard Richardson on 2011-02-14
Status: Rejected
Rejected by: Leonard Richardson on 2011-02-15
Proposed branch: lp:~leonardr/launchpadlib/edge-fakery-for-maverick
Merge into: lp:launchpadlib
Diff against target: 133 lines (+53/-0) (has conflicts)
3 files modified
src/launchpadlib/launchpad.py (+10/-0)
src/launchpadlib/tests/test_launchpad.py (+20/-0)
src/launchpadlib/uris.py (+23/-0)
Text conflict in src/launchpadlib/launchpad.py
Text conflict in src/launchpadlib/tests/test_launchpad.py
Text conflict in src/launchpadlib/uris.py
To merge this branch: bzr merge lp:~leonardr/launchpadlib/edge-fakery-for-maverick
Reviewer Review Type Date Requested Status
Graham Binns (community) code 2011-02-14 Needs Fixing on 2011-02-15
Review via email: mp+49653@code.launchpad.net

Description of the change

This branch backports my "fake edge" code (https://code.launchpad.net/~leonardr/launchpadlib/fake-edge/+merge/49651) to the version of launchpadlib found in Maverick.

To post a comment you must log in.
Graham Binns (gmb) wrote :

There are merge conflicts here; let me know when they're taken care of (or paste me a clean diff if they're spurious).

review: Needs Fixing (code)

Unmerged revisions

90. By Leonard Richardson on 2011-02-14

Ported the edge->staging code to the version of launchpadlib in Maverick.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/launchpadlib/launchpad.py'
2--- src/launchpadlib/launchpad.py 2011-02-07 20:08:28 +0000
3+++ src/launchpadlib/launchpad.py 2011-02-14 15:58:24 +0000
4@@ -44,11 +44,21 @@
5 )
6 from launchpadlib import uris
7
8+<<<<<<< TREE
9
10 # Import some constants for backwards compatibility. This way, old
11 # scripts that have 'from launchpad import STAGING_SERVICE_ROOT' will still
12+=======
13+# Set some constants for backwards compatibility. This way, old
14+# scripts that have 'from launchpad import EDGE_SERVICE_ROOT' will still
15+>>>>>>> MERGE-SOURCE
16 # work.
17+<<<<<<< TREE
18 from launchpadlib.uris import STAGING_SERVICE_ROOT
19+=======
20+STAGING_SERVICE_ROOT = 'staging'
21+EDGE_SERVICE_ROOT = 'edge'
22+>>>>>>> MERGE-SOURCE
23 OAUTH_REALM = 'https://api.launchpad.net'
24
25
26
27=== modified file 'src/launchpadlib/tests/test_launchpad.py'
28--- src/launchpadlib/tests/test_launchpad.py 2011-01-18 21:57:09 +0000
29+++ src/launchpadlib/tests/test_launchpad.py 2011-02-14 15:58:24 +0000
30@@ -24,9 +24,13 @@
31 import stat
32 import tempfile
33 import unittest
34+<<<<<<< TREE
35 import warnings
36
37 from lazr.restfulclient.resource import ServiceRoot
38+=======
39+import warnings
40+>>>>>>> MERGE-SOURCE
41
42 from launchpadlib.credentials import (
43 AccessToken,
44@@ -75,6 +79,22 @@
45 self.assertEqual(sorted(uris.service_roots.keys()), self.aliases)
46 self.assertEqual(sorted(uris.web_roots.keys()), self.aliases)
47
48+ def test_edge(self):
49+ # 'edge' is the same as 'production', since the edge server no
50+ # longer exists.
51+ with warnings.catch_warnings(record=True) as caught:
52+ self.assertEqual(uris.lookup_service_root('edge'),
53+ uris.lookup_service_root('production'))
54+
55+ self.assertEqual(uris.lookup_web_root('edge'),
56+ uris.lookup_web_root('production'))
57+
58+ self.assertEqual(len(caught), 1)
59+ warning, = caught
60+ self.assertTrue(issubclass(warning.category, DeprecationWarning))
61+ self.assertTrue("no longer exists" in warning.message.message)
62+
63+
64 def test_lookups(self):
65 """Ensure that short service names turn into long service names."""
66
67
68=== modified file 'src/launchpadlib/uris.py'
69--- src/launchpadlib/uris.py 2011-01-18 21:57:09 +0000
70+++ src/launchpadlib/uris.py 2011-02-14 15:58:24 +0000
71@@ -28,17 +28,29 @@
72 ]
73
74 from urlparse import urlparse
75+<<<<<<< TREE
76 from lazr.uri import URI
77+=======
78+import warnings
79+>>>>>>> MERGE-SOURCE
80
81 LPNET_SERVICE_ROOT = 'https://api.launchpad.net/'
82+<<<<<<< TREE
83 QASTAGING_SERVICE_ROOT = 'https://api.qastaging.launchpad.net/'
84+=======
85+EDGE_SERVICE_ROOT = 'edge'
86+>>>>>>> MERGE-SOURCE
87 STAGING_SERVICE_ROOT = 'https://api.staging.launchpad.net/'
88 DEV_SERVICE_ROOT = 'https://api.launchpad.dev/'
89 DOGFOOD_SERVICE_ROOT = 'https://api.dogfood.launchpad.net/'
90 TEST_DEV_SERVICE_ROOT = 'http://api.launchpad.dev:8085/'
91
92 LPNET_WEB_ROOT = 'https://launchpad.net/'
93+<<<<<<< TREE
94 QASTAGING_WEB_ROOT = 'https://qastaging.launchpad.net/'
95+=======
96+EDGE_WEB_ROOT = 'edge'
97+>>>>>>> MERGE-SOURCE
98 STAGING_WEB_ROOT = 'https://staging.launchpad.net/'
99 DEV_WEB_ROOT = 'https://launchpad.dev/'
100 DOGFOOD_WEB_ROOT = 'https://dogfood.launchpad.net/'
101@@ -47,7 +59,11 @@
102
103 service_roots = dict(
104 production=LPNET_SERVICE_ROOT,
105+<<<<<<< TREE
106 qastaging=QASTAGING_SERVICE_ROOT,
107+=======
108+ edge=LPNET_SERVICE_ROOT,
109+>>>>>>> MERGE-SOURCE
110 staging=STAGING_SERVICE_ROOT,
111 dogfood=DOGFOOD_SERVICE_ROOT,
112 dev=DEV_SERVICE_ROOT,
113@@ -57,7 +73,11 @@
114
115 web_roots = dict(
116 production=LPNET_WEB_ROOT,
117+<<<<<<< TREE
118 qastaging=QASTAGING_WEB_ROOT,
119+=======
120+ edge=LPNET_WEB_ROOT,
121+>>>>>>> MERGE-SOURCE
122 staging=STAGING_WEB_ROOT,
123 dogfood=DOGFOOD_WEB_ROOT,
124 dev=DEV_WEB_ROOT,
125@@ -67,6 +87,9 @@
126
127 def _dereference_alias(root, aliases):
128 """Dereference what might a URL or an alias for a URL."""
129+ if root == 'edge':
130+ warnings.warn(("Launchpad edge server no longer exists. "
131+ "Using 'production' instead."), DeprecationWarning)
132 if root in aliases:
133 return aliases[root]
134

Subscribers

People subscribed via source and target branches