

@mock.patch('swauth.authtypes.os')
def test_sha1_encode(self, os):
    os.urandom.return_value.encode.return_value.rstrip.return_value = 'salt'
    enc_key = self.auth_encoder.encode('keystring')
    self.assertEqual('sha1:salt$d50dc700c296e23ce5b41f7431a0e01f69010f06', enc_key)

dataset/ETHPy150Open openstack/swauth/test/unit/test_authtypes.py TestSha1.test_sha1_encode/original