diff src/test/helpers.py @ 941:c6d8fc63b1db

core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned
author Goffi <goffi@goffi.org>
date Fri, 28 Mar 2014 18:07:02 +0100
parents 64ec04991d9d
children e1842ebcb2f3
line wrap: on
line diff
--- a/src/test/helpers.py	Fri Mar 28 18:06:51 2014 +0100
+++ b/src/test/helpers.py	Fri Mar 28 18:07:02 2014 +0100
@@ -17,7 +17,6 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from sat.core.i18n import _
 from sat.core import exceptions
 from constants import Const
 from wokkel.xmppim import RosterItem
@@ -116,7 +115,7 @@
         @return: client or None if it doesn't exist"""
         profile = self.memory.getProfileName(profile_key)
         if not profile:
-            return None
+            raise exceptions.ProfileKeyUnknownError
         if profile not in self.profiles:
             self.profiles[profile] = FakeClient(self, profile)
             self.profiles[profile].client_initialized.callback(None)