def test_deprecation_notices_snap_not_all_mode(self): self.useFixture(EnvironmentVariable("SNAP", "/snap/maas/current")) snap_common_path = Path(self.make_dir()) self.useFixture( EnvironmentVariable("SNAP_COMMON", str(snap_common_path))) snap_common_path.joinpath("snap_mode").write_text( "region+rack", "utf-8") self.assertEqual(get_deprecations(), [])
def test_deprecation_notices_snap_all_mode(self): self.useFixture(EnvironmentVariable("SNAP", "/snap/maas/current")) snap_common_path = Path(self.make_dir()) self.useFixture( EnvironmentVariable("SNAP_COMMON", str(snap_common_path))) snap_common_path.joinpath("snap_mode").write_text("all", "utf-8") [notice] = get_deprecations() self.assertEqual(notice["id"], "MD1") self.assertEqual(notice["since"], "2.8") self.assertEqual(notice["url"], "https://maas.io/deprecations/MD1")
def test_empty(self): self.assertEqual(get_deprecations(), [])
def deprecation_notices(self, params): """Return currently active deprecation notices to display to the user.""" return get_deprecations()