Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions libmozdata/fx_trains.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,16 @@ def get_firefox_releases(self):
api_path = "firefox/releases/"
return self.__get(api_path)

def get_lando_uplift_train(self):
"""Get the current version and release date for each channel.

Returns:
dict: keyed by channel (nightly, beta, release, esr, esr_previous),
each value a dict with at least a "version" (int) key. A channel
may be null (e.g. esr_previous outside an ESR overlap period).
"""

api_path = "lando/uplift/train/"
return self.__get(api_path)

# TODO: add methods for the other API endpoints
7 changes: 7 additions & 0 deletions tests/test_fx_trains.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def test_get_firefox_releases(self):
release_dates = fx_trains.get_firefox_releases()
self.assertEqual(release_dates["29.0"], "2014-04-29")

@responses.activate
def test_get_lando_uplift_train(self):
fx_trains = FirefoxTrains()
uplift_train = fx_trains.get_lando_uplift_train()
self.assertIn("nightly", uplift_train)
self.assertIn("version", uplift_train["nightly"])

@responses.activate
def test_get_release_schedule(self):
fx_trains = FirefoxTrains()
Expand Down