Adding unit tests for credentials.extract