Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /SHAdd0WTAka_Zen-Ai-Pentest /tests /massive /test_db_massive.py
| """Massive DB Tests - Auto-generated.""" | |
| import pytest | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker | |
| from database.auth_models import Base as AuthBase | |
| from database.models import Base | |
| def db_session(): | |
| engine = create_engine("sqlite:///:memory:") | |
| Base.metadata.create_all(engine) | |
| AuthBase.metadata.create_all(engine) | |
| Session = sessionmaker(bind=engine) | |
| yield Session() | |
| def test_user_create(db_session): | |
| from database.models import User | |
| obj = User() | |
| db_session.add(obj) | |
| db_session.commit() | |
| assert obj.id is not None | |
| def test_user_query(db_session): | |
| from database.models import User | |
| result = db_session.query(User).all() | |
| assert isinstance(result, list) | |
| def test_scan_create(db_session): | |
| from database.models import Scan | |
| obj = Scan() | |
| db_session.add(obj) | |
| db_session.commit() | |
| assert obj.id is not None | |
| def test_scan_query(db_session): | |
| from database.models import Scan | |
| result = db_session.query(Scan).all() | |
| assert isinstance(result, list) | |
| def test_finding_create(db_session): | |
| from database.models import Finding | |
| obj = Finding() | |
| db_session.add(obj) | |
| db_session.commit() | |
| assert obj.id is not None | |
| def test_finding_query(db_session): | |
| from database.models import Finding | |
| result = db_session.query(Finding).all() | |
| assert isinstance(result, list) | |
| def test_report_create(db_session): | |
| from database.models import Report | |
| obj = Report() | |
| db_session.add(obj) | |
| db_session.commit() | |
| assert obj.id is not None | |
| def test_report_query(db_session): | |
| from database.models import Report | |
| result = db_session.query(Report).all() | |
| assert isinstance(result, list) | |
| def test_asset_create(db_session): | |
| from database.models import Asset | |
| obj = Asset() | |
| db_session.add(obj) | |
| db_session.commit() | |
| assert obj.id is not None | |
| def test_asset_query(db_session): | |
| from database.models import Asset | |
| result = db_session.query(Asset).all() | |
| assert isinstance(result, list) | |
| def test_notification_create(db_session): | |
| from database.models import Notification | |
| obj = Notification() | |
| db_session.add(obj) | |
| db_session.commit() | |
| assert obj.id is not None | |
| def test_notification_query(db_session): | |
| from database.models import Notification | |
| result = db_session.query(Notification).all() | |
| assert isinstance(result, list) | |
Xet Storage Details
- Size:
- 2.44 kB
- Xet hash:
- 32ef355c7468cafa573a327c82467cd453a63a94aad20fc451e1141b89db6df8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.