Beispiel #1
0
    def __init__(self, version, support=None, session=None):
        super(ConnectMessage, self).__init__()
        self._version = version
        self._support = default(support, [version])
        self._session = session

        if self._version not in self._support:
            raise ValueError('support must contain version')
Beispiel #2
0
    def __init__(self, version, support=None, session=None):
        super(ConnectMessage, self).__init__()
        self._version = version
        self._support = default(support, [version])
        self._session = session

        if self._version not in self._support:
            raise ValueError('support must contain version')
Beispiel #3
0
 def test_given_object_given_value_given_factory(self):
     with self.assertRaises(ValueError):
         default(self.obj, value=self.value, factory=self.factory)
Beispiel #4
0
 def test_given_factory(self):
     self.assertEqual(default(None, factory=self.factory),
                      self.factory_value)
Beispiel #5
0
 def test_given_value(self):
     self.assertEqual(default(None, value=self.value), self.value)
Beispiel #6
0
 def test_given_object_given_factory(self):
     self.assertEqual(default(self.obj, factory=self.factory), self.obj)
Beispiel #7
0
 def test_given_object_given_value(self):
     self.assertEqual(default(self.obj, value=self.value), self.obj)