From a053bbd09ae7e887c42e68ab07f949e40fbcf338 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Mon, 2 Feb 2026 20:50:59 +0000 Subject: [PATCH] Initial upload: Code Privacy Shield v0.1.0 --- tests/conftest.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..529dce7 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,57 @@ +import pytest +from code_privacy_shield.patterns import PatternLibrary +from code_privacy_shield.redactor import Redactor +from code_privacy_shield.config import Config + + +@pytest.fixture +def pattern_library(): + return PatternLibrary() + + +@pytest.fixture +def redactor(): + return Redactor() + + +@pytest.fixture +def config(): + return Config() + + +@pytest.fixture +def sample_sensitive_code(): + return ''' +import os +import requests + +API_KEY = "sk-abc123def456ghi789" +DATABASE_URL = "postgresql://user:password@localhost:5432/mydb" +EMAIL = "developer@company.com" +AWS_SECRET = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" + +# Environment variable access +db_password = os.environ.get("DB_PASSWORD") + +# Database connection +conn_string = "mysql://admin:secretpass@db.example.com:3306/users" + +# Authorization header +headers = {"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"} +''' + + +@pytest.fixture +def sample_clean_code(): + return ''' +def calculate_sum(a, b): + """Calculate sum of two numbers.""" + return a + b + +class MyClass: + def __init__(self, value): + self.value = value + + def get_value(self): + return self.value +'''