Пример #1
0
 def start(self, connection):
     if self.username is None or self.password is None:
         return NotImplemented
     login_response = BytesIO()
     _write_table({b'LOGIN': self.username, b'PASSWORD': self.password},
                  login_response.write, [])
     # Skip the length at the beginning
     return login_response.getvalue()[4:]
Пример #2
0
 def start(self, connection):
     login_response = BytesIO()
     _write_table({
         b'LOGIN': self.username,
         b'PASSWORD': self.password
     }, login_response.write, [])
     # Skip the length at the beginning
     return login_response.getvalue()[4:]
Пример #3
0
 def test_amqplain(self):
     username, password = '******', 'bar'
     mech = sasl.AMQPLAIN(username, password)
     response = mech.start(None)
     assert isinstance(response, bytes)
     login_response = BytesIO()
     _write_table({b'LOGIN': username, b'PASSWORD': password},
                  login_response.write, [])
     expected_response = login_response.getvalue()[4:]
     assert response == expected_response
Пример #4
0
 def start(self, connection):
     if self.username is None or self.password is None:
         return NotImplemented
     login_response = BytesIO()
     _write_table(
         {b"LOGIN": self.username, b"PASSWORD": self.password},
         login_response.write,
         [],
     )
     # Skip the length at the beginning
     return login_response.getvalue()[4:]