Skip to content

Commit

Permalink
ajustemet du code
Browse files Browse the repository at this point in the history
  • Loading branch information
juguirlet committed Dec 16, 2023
1 parent c630740 commit f6e3900
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
import streamlit as st
from app.app import get_customers_ids, get_customer_values, get_features_selected, get_customer_shap_values, request_prediction, construire_jauge_score
import app
import matplotlib.pyplot as plt

# Création d'un client fictif pour tester l'application sur streamlit
Expand All @@ -10,21 +10,21 @@ def streamlit_client():
yield st

def test_get_customers_ids(streamlit_client):
customers_ids = get_customers_ids()
customers_ids = app.get_customers_ids()
assert isinstance(customers_ids, list)

def test_get_customer_values(streamlit_client):
customer_id = 100038
customer_values = get_customer_values(customer_id)
customer_values = app.get_customer_values(customer_id)
assert isinstance(customer_values, dict)

def test_get_features_selected(streamlit_client):
features_selected_list = get_features_selected()
features_selected_list = app.get_features_selected()
assert isinstance(features_selected_list, list)

def test_get_customer_shap_values(streamlit_client):
data_df = st.cache(lambda: app.app_test.head(1))()
shap_values_list, _, _ = get_customer_shap_values(data_df)
shap_values_list, _, _ = app.get_customer_shap_values(data_df)
assert isinstance(shap_values_list, list)

def test_request_prediction(streamlit_client):
Expand All @@ -35,7 +35,7 @@ def test_request_prediction(streamlit_client):

def test_construire_jauge_score(streamlit_client):
score_remboursement_client = 0.7
jauge_score = construire_jauge_score(score_remboursement_client)
jauge_score = app.construire_jauge_score(score_remboursement_client)
assert isinstance(jauge_score, plt.Figure)

if __name__ == "__main__":
Expand Down

0 comments on commit f6e3900

Please sign in to comment.