Merge lp://staging/~ralsina/ubuntu-rest-scopes/short-digits-vulgarian into lp://staging/ubuntu-rest-scopes

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 508
Merged at revision: 507
Proposed branch: lp://staging/~ralsina/ubuntu-rest-scopes/short-digits-vulgarian
Merge into: lp://staging/ubuntu-rest-scopes
Diff against target: 25 lines (+3/-2)
2 files modified
src/scopes/tests/test_weatherchannel.py (+1/-1)
src/scopes/weatherchannel.py (+2/-1)
To merge this branch: bzr merge lp://staging/~ralsina/ubuntu-rest-scopes/short-digits-vulgarian
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+288311@code.staging.launchpad.net

Commit message

Limit lat/long to 2 decimals in search_location to avoid TWC API error.

Description of the change

So, TWC doesn't like too many decimals on the location query. Oops, I guess.

Limiting to 2 decimals, which gives a precision of ~15 meters on each direction, so it should be enough to know on which city you are in most cases.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

+1, short and sweet.

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

The attempt to merge lp:~ralsina/ubuntu-rest-scopes/short-digits-vulgarian into lp:ubuntu-rest-scopes failed. Below is the output from the failed tests.

......................................................................................................................................................................................................................................F.............................................................................................................................
======================================================================
FAIL: test__get_location_key_simple (src.scopes.tests.test_weatherchannel.TWCInterfaceTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/tarmac/cache/ubuntu-rest-scopes/trunk/src/scopes/tests/test_weatherchannel.py", line 767, in test__get_location_key_simple
    mock.assert_called_with(loc_uri)
  File "/usr/lib/python2.7/dist-packages/mock.py", line 835, in assert_called_with
    raise AssertionError(msg)
AssertionError: Expected call: mock('https://api.weather.com/v2/location?geocode=1.0,1.0&language=en-GB&format=json&apiKey=bar')
Actual call: mock('https://api.weather.com/v2/location?geocode=1.00,1.00&language=en-GB&format=json&apiKey=bar')

----------------------------------------------------------------------
Ran 356 tests in 16.204s

FAILED (failures=1)

Revision history for this message
Daniel Manrique (roadmr) wrote :

Ahaha, now I get to play smug and say "yes, I forgot to ask about any tests that may need updating" :)

508. By Roberto Alsina

fix test

Revision history for this message
Roberto Alsina (ralsina) wrote :

> Ahaha, now I get to play smug and say "yes, I forgot to ask about any tests
> that may need updating" :)

YOU MEAN YOU DIDN'T RUN THE TESTS???? ;-)

Revision history for this message
Roberto Alsina (ralsina) wrote :

In any case, this branch will merge pushed by the intensity of my hatred for this API.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches