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

Proposed by Leonard Richardson
Status: Rejected
Rejected by: Leonard Richardson
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 Needs Fixing
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.
Revision history for this message
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

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
=== modified file 'src/launchpadlib/launchpad.py'
--- src/launchpadlib/launchpad.py 2011-02-07 20:08:28 +0000
+++ src/launchpadlib/launchpad.py 2011-02-14 15:58:24 +0000
@@ -44,11 +44,21 @@
44 )44 )
45from launchpadlib import uris45from launchpadlib import uris
4646
47<<<<<<< TREE
4748
48# Import some constants for backwards compatibility. This way, old49# Import some constants for backwards compatibility. This way, old
49# scripts that have 'from launchpad import STAGING_SERVICE_ROOT' will still50# scripts that have 'from launchpad import STAGING_SERVICE_ROOT' will still
51=======
52# Set some constants for backwards compatibility. This way, old
53# scripts that have 'from launchpad import EDGE_SERVICE_ROOT' will still
54>>>>>>> MERGE-SOURCE
50# work.55# work.
56<<<<<<< TREE
51from launchpadlib.uris import STAGING_SERVICE_ROOT57from launchpadlib.uris import STAGING_SERVICE_ROOT
58=======
59STAGING_SERVICE_ROOT = 'staging'
60EDGE_SERVICE_ROOT = 'edge'
61>>>>>>> MERGE-SOURCE
52OAUTH_REALM = 'https://api.launchpad.net'62OAUTH_REALM = 'https://api.launchpad.net'
5363
5464
5565
=== modified file 'src/launchpadlib/tests/test_launchpad.py'
--- src/launchpadlib/tests/test_launchpad.py 2011-01-18 21:57:09 +0000
+++ src/launchpadlib/tests/test_launchpad.py 2011-02-14 15:58:24 +0000
@@ -24,9 +24,13 @@
24import stat24import stat
25import tempfile25import tempfile
26import unittest26import unittest
27<<<<<<< TREE
27import warnings28import warnings
2829
29from lazr.restfulclient.resource import ServiceRoot30from lazr.restfulclient.resource import ServiceRoot
31=======
32import warnings
33>>>>>>> MERGE-SOURCE
3034
31from launchpadlib.credentials import (35from launchpadlib.credentials import (
32 AccessToken,36 AccessToken,
@@ -75,6 +79,22 @@
75 self.assertEqual(sorted(uris.service_roots.keys()), self.aliases)79 self.assertEqual(sorted(uris.service_roots.keys()), self.aliases)
76 self.assertEqual(sorted(uris.web_roots.keys()), self.aliases)80 self.assertEqual(sorted(uris.web_roots.keys()), self.aliases)
7781
82 def test_edge(self):
83 # 'edge' is the same as 'production', since the edge server no
84 # longer exists.
85 with warnings.catch_warnings(record=True) as caught:
86 self.assertEqual(uris.lookup_service_root('edge'),
87 uris.lookup_service_root('production'))
88
89 self.assertEqual(uris.lookup_web_root('edge'),
90 uris.lookup_web_root('production'))
91
92 self.assertEqual(len(caught), 1)
93 warning, = caught
94 self.assertTrue(issubclass(warning.category, DeprecationWarning))
95 self.assertTrue("no longer exists" in warning.message.message)
96
97
78 def test_lookups(self):98 def test_lookups(self):
79 """Ensure that short service names turn into long service names."""99 """Ensure that short service names turn into long service names."""
80100
81101
=== modified file 'src/launchpadlib/uris.py'
--- src/launchpadlib/uris.py 2011-01-18 21:57:09 +0000
+++ src/launchpadlib/uris.py 2011-02-14 15:58:24 +0000
@@ -28,17 +28,29 @@
28 ]28 ]
2929
30from urlparse import urlparse30from urlparse import urlparse
31<<<<<<< TREE
31from lazr.uri import URI32from lazr.uri import URI
33=======
34import warnings
35>>>>>>> MERGE-SOURCE
3236
33LPNET_SERVICE_ROOT = 'https://api.launchpad.net/'37LPNET_SERVICE_ROOT = 'https://api.launchpad.net/'
38<<<<<<< TREE
34QASTAGING_SERVICE_ROOT = 'https://api.qastaging.launchpad.net/'39QASTAGING_SERVICE_ROOT = 'https://api.qastaging.launchpad.net/'
40=======
41EDGE_SERVICE_ROOT = 'edge'
42>>>>>>> MERGE-SOURCE
35STAGING_SERVICE_ROOT = 'https://api.staging.launchpad.net/'43STAGING_SERVICE_ROOT = 'https://api.staging.launchpad.net/'
36DEV_SERVICE_ROOT = 'https://api.launchpad.dev/'44DEV_SERVICE_ROOT = 'https://api.launchpad.dev/'
37DOGFOOD_SERVICE_ROOT = 'https://api.dogfood.launchpad.net/'45DOGFOOD_SERVICE_ROOT = 'https://api.dogfood.launchpad.net/'
38TEST_DEV_SERVICE_ROOT = 'http://api.launchpad.dev:8085/'46TEST_DEV_SERVICE_ROOT = 'http://api.launchpad.dev:8085/'
3947
40LPNET_WEB_ROOT = 'https://launchpad.net/'48LPNET_WEB_ROOT = 'https://launchpad.net/'
49<<<<<<< TREE
41QASTAGING_WEB_ROOT = 'https://qastaging.launchpad.net/'50QASTAGING_WEB_ROOT = 'https://qastaging.launchpad.net/'
51=======
52EDGE_WEB_ROOT = 'edge'
53>>>>>>> MERGE-SOURCE
42STAGING_WEB_ROOT = 'https://staging.launchpad.net/'54STAGING_WEB_ROOT = 'https://staging.launchpad.net/'
43DEV_WEB_ROOT = 'https://launchpad.dev/'55DEV_WEB_ROOT = 'https://launchpad.dev/'
44DOGFOOD_WEB_ROOT = 'https://dogfood.launchpad.net/'56DOGFOOD_WEB_ROOT = 'https://dogfood.launchpad.net/'
@@ -47,7 +59,11 @@
4759
48service_roots = dict(60service_roots = dict(
49 production=LPNET_SERVICE_ROOT,61 production=LPNET_SERVICE_ROOT,
62<<<<<<< TREE
50 qastaging=QASTAGING_SERVICE_ROOT,63 qastaging=QASTAGING_SERVICE_ROOT,
64=======
65 edge=LPNET_SERVICE_ROOT,
66>>>>>>> MERGE-SOURCE
51 staging=STAGING_SERVICE_ROOT,67 staging=STAGING_SERVICE_ROOT,
52 dogfood=DOGFOOD_SERVICE_ROOT,68 dogfood=DOGFOOD_SERVICE_ROOT,
53 dev=DEV_SERVICE_ROOT,69 dev=DEV_SERVICE_ROOT,
@@ -57,7 +73,11 @@
5773
58web_roots = dict(74web_roots = dict(
59 production=LPNET_WEB_ROOT,75 production=LPNET_WEB_ROOT,
76<<<<<<< TREE
60 qastaging=QASTAGING_WEB_ROOT,77 qastaging=QASTAGING_WEB_ROOT,
78=======
79 edge=LPNET_WEB_ROOT,
80>>>>>>> MERGE-SOURCE
61 staging=STAGING_WEB_ROOT,81 staging=STAGING_WEB_ROOT,
62 dogfood=DOGFOOD_WEB_ROOT,82 dogfood=DOGFOOD_WEB_ROOT,
63 dev=DEV_WEB_ROOT,83 dev=DEV_WEB_ROOT,
@@ -67,6 +87,9 @@
6787
68def _dereference_alias(root, aliases):88def _dereference_alias(root, aliases):
69 """Dereference what might a URL or an alias for a URL."""89 """Dereference what might a URL or an alias for a URL."""
90 if root == 'edge':
91 warnings.warn(("Launchpad edge server no longer exists. "
92 "Using 'production' instead."), DeprecationWarning)
70 if root in aliases:93 if root in aliases:
71 return aliases[root]94 return aliases[root]
7295

Subscribers

People subscribed via source and target branches