def test_not_installed(self, mock_is_service_installed, mock_sbd_name): mock_obj = mock.MagicMock() mock_is_service_installed.return_value = False mock_sbd_name.return_value = "sbd" self.assertFalse(lib_sbd.is_sbd_installed(mock_obj)) mock_is_service_installed.assert_called_once_with(mock_obj, "sbd") mock_sbd_name.assert_called_once_with()
def test_installed(self, mock_sbd_name): mock_obj = mock.MagicMock() mock_obj.is_installed.return_value = True mock_sbd_name.return_value = self.service self.assertTrue(lib_sbd.is_sbd_installed(mock_obj)) mock_obj.is_installed.assert_called_once_with(self.service) mock_sbd_name.assert_called_once_with(mock_obj)
def test_not_installed(self, mock_is_service_installed): mock_obj = mock.MagicMock() mock_is_service_installed.return_value = False self.assertFalse(lib_sbd.is_sbd_installed(mock_obj))