Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aliviahossain/Disease-prediction
/ functions
Functions
597 in github.com/aliviahossain/Disease-prediction
⨍
Functions
597
◇
Types & classes
52
↳
Endpoints
60
Function
test_logout_post_succeeds
(client)
backend/tests/test_auth_routes.py:4
Function
test_low_probabilities
()
backend/tests/test_validation.py:102
Method
test_low_probabilities
(self)
backend/tests/test_calculator.py:44
Method
test_low_threshold_variant_accepts_lower_score
(self)
backend/tests/test_uncertainty_handler.py:137
Method
test_medium_score_with_clear_margin_is_sufficient
(self)
backend/tests/test_uncertainty_handler.py:133
Function
test_mid_range_probabilities
()
backend/tests/test_validation.py:88
Method
test_mid_range_probabilities
(self)
backend/tests/test_calculator.py:40
Function
test_ml_prediction_returns_feature_impacts_and_summary
()
backend/tests/test_ml_explainability.py:4
Method
test_narrow_margin_is_insufficient
(self)
backend/tests/test_uncertainty_handler.py:67
Method
test_no_top2_skips_margin_check
(self)
backend/tests/test_uncertainty_handler.py:81
Function
test_normalize_key_handles_display_labels
()
backend/tests/test_preprocessing.py:14
Method
test_pagination
(self, app, client, make_user)
backend/tests/test_patient_history.py:267
Method
test_patient_dashboard_requires_login
Test that patient dashboard redirects unauthenticated users to login.
backend/tests/test_doctor_dashboard.py:326
Method
test_prediction_endpoint_error_handling
Test that prediction endpoint returns JSON on error
backend/tests/test_fetch_endpoints.py:164
Method
test_prediction_endpoint_with_valid_symptoms
Test prediction endpoint returns proper response
backend/tests/test_fetch_endpoints.py:136
Method
test_prediction_risk_level_saved
Test that risk level is correctly saved based on probability.
backend/tests/test_doctor_dashboard.py:226
Method
test_prediction_saved_to_database
Test that predictions are saved to the database.
backend/tests/test_doctor_dashboard.py:206
Method
test_prediction_symptoms_stored_as_json
Test that symptoms are stored as JSON string.
backend/tests/test_doctor_dashboard.py:249
Function
test_preset_disease_calculation
Test preset disease endpoint with valid data
backend/tests/test_integration.py:28
Function
test_preset_invalid_disease
Test preset disease endpoint with invalid disease
backend/tests/test_integration.py:43
Function
test_preset_missing_disease_field
(client)
backend/tests/test_integration.py:111
Function
test_prior_out_of_bounds
(prior)
backend/tests/test_validation.py:17
Function
test_production_missing_gemini_key
Test that ValueError is raised in production when GEMINI_API_KEY is missing
backend/tests/test_startup_validation.py:49
Function
test_production_missing_model_files
Test that FileNotFoundError is raised in production when a model file is missing
backend/tests/test_startup_validation.py:66
Function
test_production_missing_secret_key
Test that ValueError is raised in production when SECRET_KEY is missing
backend/tests/test_startup_validation.py:17
Function
test_production_weak_secret_key
Test that ValueError is raised in production when SECRET_KEY is too short/weak
backend/tests/test_startup_validation.py:34
Function
test_profile_accepts_valid_contact_demographics_and_metrics
(client)
backend/tests/test_profile_validation.py:101
Function
test_profile_handles_readonly_database_without_500
(client, monkeypatch)
backend/tests/test_profile_validation.py:162
Function
test_profile_rejects_incomplete_dropdown_dob
(client)
backend/tests/test_profile_validation.py:239
Function
test_profile_rejects_invalid_contact_and_future_dob
(client)
backend/tests/test_profile_validation.py:42
Function
test_profile_rejects_negative_physical_metrics
(client)
backend/tests/test_profile_validation.py:147
Function
test_profile_rejects_numbers_in_medical_safety_fields
(client)
backend/tests/test_profile_validation.py:186
Function
test_profile_rejects_phone_without_country_code_plus
(client)
backend/tests/test_profile_validation.py:133
Function
test_profile_rejects_unrealistic_old_dob
(client)
backend/tests/test_profile_validation.py:90
Function
test_profile_renders_dob_dropdown_options
(client)
backend/tests/test_profile_validation.py:71
Function
test_profile_renders_medical_safety_digit_blockers
(client)
backend/tests/test_profile_validation.py:81
Function
test_profile_update_preserves_fields_not_in_post
(client)
backend/tests/test_profile_validation.py:201
Function
test_profile_update_without_csrf_returns_400
POST /profile/update with no CSRF token must be rejected.
backend/tests/test_csrf.py:88
Function
test_rare_combinations
Test rare symptom combinations.
backend/tests/test_synthetic.py:29
Function
test_rate_limiter_load_in_memory
Test that RateLimiter initializes InMemoryBackend by default or when configured.
backend/tests/test_rate_limiter.py:210
Function
test_rate_limiter_load_redis_fallback
Test that RateLimiter falls back to InMemoryBackend if Redis connection/initialization fails.
backend/tests/test_rate_limiter.py:234
Function
test_rate_limiter_load_sqlite
Test that RateLimiter initializes SQLiteBackend when configured.
backend/tests/test_rate_limiter.py:218
Method
test_reason_is_non_empty_for_low_confidence
(self)
backend/tests/test_uncertainty_handler.py:98
Method
test_reason_is_none_when_sufficient
(self)
backend/tests/test_uncertainty_handler.py:117
Method
test_reason_mentions_disease_names_for_margin_fail
(self)
backend/tests/test_uncertainty_handler.py:107
Method
test_reason_mentions_threshold_percentage
(self)
backend/tests/test_uncertainty_handler.py:103
Function
test_redis_backend_lua_mock
Test RedisBackend using mock Redis client executing Lua script.
backend/tests/test_rate_limiter.py:173
Method
test_risk_classifier
(self, prob, expected)
backend/tests/test_patient_history.py:229
Function
test_sanitize_via_preset_strips_script_tag
(client)
tests/test_disease_routes.py:131
Function
test_sanitize_via_preset_truncates_long_name
(client)
tests/test_disease_routes.py:138
Method
test_save_for_anonymous_user_is_noop
(self, app)
backend/tests/test_patient_history.py:190
Method
test_save_never_raises_on_bad_input
A history failure must never break the prediction itself.
backend/tests/test_patient_history.py:200
Method
test_save_persists_row
(self, app)
backend/tests/test_patient_history.py:175
Function
test_secret_key_auto_generated_in_dev
Test that app auto-generates SECRET_KEY in development when not provided
backend/tests/test_secret_key.py:51
Function
test_secret_key_from_env
Test that app loads SECRET_KEY from environment variable
backend/tests/test_secret_key.py:15
Function
test_secret_key_length_validation
Test that app requires a reasonably long SECRET_KEY
backend/tests/test_secret_key.py:92
Function
test_secret_key_missing_in_production
Test that app raises error when SECRET_KEY is missing in production
backend/tests/test_secret_key.py:32
Function
test_secret_key_not_hardcoded
Test that SECRET_KEY is not hardcoded in the application
backend/tests/test_secret_key.py:111
Function
test_secret_key_with_flask_debug_flag
Test that app recognizes FLASK_DEBUG=1 as development mode
backend/tests/test_secret_key.py:73
Function
test_sensitivity_out_of_bounds
(sens)
backend/tests/test_validation.py:24
Method
test_server_error_returns_json
Test that 500 errors return JSON
backend/tests/test_fetch_endpoints.py:208
Function
test_signup_with_valid_csrf_is_not_rejected_for_csrf
POST /signup with a valid CSRF token must not return 400 (CSRF passes).
backend/tests/test_csrf.py:122
Function
test_signup_without_csrf_returns_400
POST /signup with no CSRF token must be rejected.
backend/tests/test_csrf.py:79
Function
test_specificity_out_of_bounds
(spec)
backend/tests/test_validation.py:31
Function
test_sqlite_backend_basic
Test SQLiteBackend basic functionality.
backend/tests/test_rate_limiter.py:112
Function
test_sqlite_backend_cleanup
Test SQLiteBackend cleanup of stale entries.
backend/tests/test_rate_limiter.py:146
Method
test_strict_threshold_accepts_high_confidence
(self)
backend/tests/test_uncertainty_handler.py:147
Method
test_strict_threshold_rejects_borderline
(self)
backend/tests/test_uncertainty_handler.py:142
Method
test_successful_response_has_200
Test that successful responses have 200 status
backend/tests/test_fetch_endpoints.py:226
Method
test_sufficient_margin_is_ok
(self)
backend/tests/test_uncertainty_handler.py:77
Method
test_symptoms_endpoint_error_handling
Test that symptoms endpoint handles errors gracefully
backend/tests/test_fetch_endpoints.py:117
Method
test_symptoms_endpoint_returns_json
Test that symptoms endpoint returns valid JSON
backend/tests/test_fetch_endpoints.py:88
Method
test_symptoms_response_format
Test that symptoms response has correct format for frontend
backend/tests/test_fetch_endpoints.py:99
Method
test_to_dict
Test that to_dict returns correct structure.
backend/tests/test_doctor_dashboard.py:297
Method
test_to_dict_handles_bad_json
(self, app)
backend/tests/test_patient_history.py:158
Method
test_to_dict_round_trip
(self, app)
backend/tests/test_patient_history.py:136
Function
test_tts_exactly_max_length
(client)
tests/test_disease_routes.py:44
Function
test_tts_exceeds_max_length
(client)
tests/test_disease_routes.py:36
Function
test_tts_invalid_language
(client)
tests/test_disease_routes.py:20
Function
test_tts_no_text
(client)
tests/test_disease_routes.py:52
Function
test_tts_valid_language
(client)
tests/test_disease_routes.py:28
Function
test_type_errors
(args)
backend/tests/test_validation.py:66
Function
test_typical_valid_cases
()
backend/tests/test_validation.py:73
Method
test_unauthorized_returns_json_not_html
Test that 401 errors return JSON, not HTML
backend/tests/test_fetch_endpoints.py:183
Function
test_user
Create a test user and return their ID
backend/tests/test_fetch_endpoints.py:29
Function
test_user
Create a real user for authenticated dashboard tests.
backend/tests/test_doctor_dashboard.py:54
Function
test_valid_bounds_negative
()
backend/tests/test_validation.py:11
Function
test_valid_bounds_positive
()
backend/tests/test_validation.py:6
Function
test_validation_passes_when_valid
Test that validation passes completely without warning/error when everything is present
backend/tests/test_startup_validation.py:105
Method
test_verify_order_invariance_on_symptom_sequences
(self)
backend/tests/test_calculator.py:153
Function
text_to_speech
()
backend/routes/disease_routes.py:489
Function
update_profile
()
backend/routes/auth_routes.py:309
Function
usePreset
()
backend/static/script.js:303
Method
validate_disease_name
Validate disease name. Args: disease: Disease name Returns: Tuple of (is_valid: bool, error_message
backend/middleware/security.py:486
Function
validate_json_request
Decorator to validate that request contains valid JSON. Example: @app.route('/api/predict', methods=['POST']) @validate_json
backend/middleware/error_handler.py:385
Function
validate_request_data
Decorator for validating request data. Args: required_fields: List of required field names optional_fields: List of optional
backend/middleware/security.py:569
Method
validate_symptoms
Validate symptom list. Args: symptoms: List of symptoms Returns: Tuple of (is_valid: bool, error_me
backend/middleware/security.py:452
← previous
501–597 of 597, ranked by callers