diff --git a/libmozdata/fx_trains.py b/libmozdata/fx_trains.py index 335d9beb..c074d804 100644 --- a/libmozdata/fx_trains.py +++ b/libmozdata/fx_trains.py @@ -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 diff --git a/tests/test_fx_trains.py b/tests/test_fx_trains.py index d10b8423..66c74650 100644 --- a/tests/test_fx_trains.py +++ b/tests/test_fx_trains.py @@ -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()