Ejemplo n.º 1
0
 def test_target_version_snap_cohort(self):
     controller = factory.make_RackController()
     ControllerInfo.objects.set_versions_info(
         controller,
         SnapVersionsInfo(
             current={
                 "version": "3.0.0~beta2-123-g.asdf",
                 "revision": "1234",
             },
             channel="3.0/beta",
             cohort="abc",
         ),
     )
     handler = GeneralHandler(factory.make_User(), {}, None)
     result = handler.target_version({})
     self.assertEqual(result["snap_cohort"], "abc")
Ejemplo n.º 2
0
 def test_target_version(self):
     controller = factory.make_RackController()
     ControllerInfo.objects.set_versions_info(
         controller,
         SnapVersionsInfo(
             current={
                 "version": "3.0.0~beta2-123-g.asdf",
                 "revision": "1234",
             },
             update={
                 "version": "3.0.0~beta3-456-g.cafe",
                 "revision": "5678",
             },
             channel="3.0/beta",
         ),
     )
     handler = GeneralHandler(factory.make_User(), {}, None)
     result = handler.target_version({})
     self.assertEqual(result["version"], "3.0.0~beta3-456-g.cafe")
     self.assertEqual(result["snap_channel"], "3.0/beta")
     self.assertIsNotNone(result["first_reported"])