def test_clean_old_jobs_purge(self): """ Tests that the function returns None when no jid_root is found. """ connect_mock = MagicMock() with patch.object(pgjsonb, "_get_serv", connect_mock): with patch.dict(pgjsonb.__salt__, {"config.option": MagicMock()}): self.assertEqual(pgjsonb.clean_old_jobs(), None)
def test_clean_old_jobs_archive(self): ''' Tests that the function returns None when no jid_root is found. ''' connect_mock = MagicMock() with patch.object(pgjsonb, '_get_serv', connect_mock): with patch.dict(pgjsonb.__salt__, {'config.option': MagicMock()}): with patch.dict(pgjsonb.__opts__, {'archive_jobs': 1}): self.assertEqual(pgjsonb.clean_old_jobs(), None)