def test_valid_id_exception_handler(self): ''' Ensure we just return False if we pass in invalid or undefined paths. Refs #8259 ''' opts = {'pki_dir': '/tmp/whatever'} self.assertFalse(valid_id(opts, None))
def test_valid_id_exception_handler(self): """ Ensure we just return False if we pass in invalid or undefined paths. Refs #8259 """ opts = {"pki_dir": "/tmp/whatever"} self.assertFalse(valid_id(opts, None))
def test_valid_id_pathsep(self): ''' Path separators in id should make it invalid ''' opts = {'pki_dir': '/tmp/whatever'} # We have to test both path separators because os.path.normpath will # convert forward slashes to backslashes on Windows. for pathsep in ('/', '\\'): self.assertFalse(valid_id(opts, pathsep.join(('..', 'foobar'))))
def test_valid_id_pathsep(self): """ Path separators in id should make it invalid """ opts = {"pki_dir": "/tmp/whatever"} # We have to test both path separators because os.path.normpath will # convert forward slashes to backslashes on Windows. for pathsep in ("/", "\\"): self.assertFalse(valid_id(opts, pathsep.join(("..", "foobar"))))