Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_disallow_options(self):
file_obj = StringIO("""command="dump /home",no-pty,no-port-forwarding """ + DEFAULT_KEY)
self.assertRaises(InvalidOptionsError, AuthorizedKeysFile, file_obj, disallow_options=True)
file_obj.seek(0)
key_file = AuthorizedKeysFile(file_obj)
self.assertEqual(len(key_file.keys), 1)