Exemplo n.º 1
0
 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(), [])
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 def test_empty(self):
     self.assertEqual(get_deprecations(), [])
Exemplo n.º 4
0
 def deprecation_notices(self, params):
     """Return currently active deprecation notices to display to the user."""
     return get_deprecations()