def test004_set_status_not_existing(self): self.assertEqual(self.scan.status, IrmaScanStatus.empty) status = "whatever" with self.assertRaises(ValueError): module.set_status(self.scan, status, self.session) self.assertEqual(self.scan.status, IrmaScanStatus.empty) self.session.commit.assert_not_called()
def test_set_status_not_existing(self): self.assertEqual(self.scan.status, IrmaScanStatus.empty) status = "whatever" with self.assertRaises(ValueError): module.set_status(self.scan, status, self.session) self.assertEqual(self.scan.status, IrmaScanStatus.empty) self.session.commit.assert_not_called()
def test003_set_status_existing(self): self.assertEqual(self.scan.status, IrmaScanStatus.empty) status = choice(IrmaScanStatus.label.keys()) module.set_status(self.scan, status, self.session) self.assertEqual(self.scan.status, status) self.session.commit.assert_called_once()
def test_set_status_existing(self): self.assertEqual(self.scan.status, IrmaScanStatus.empty) status = choice(list(IrmaScanStatus.label.keys())) module.set_status(self.scan, status, self.session) self.assertEqual(self.scan.status, status) self.session.commit.assert_called_once()