RajaThor commited on
Commit
a40faa4
·
verified ·
1 Parent(s): c939a45

Create test_recognize_face.py

Browse files
Files changed (1) hide show
  1. test_recognize_face.py +22 -0
test_recognize_face.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit.testing as stt
2
+
3
+ def test_recognize_face():
4
+ with stt.install_test_input():
5
+ stt.test_runner.start("path_to_your_script.py")
6
+
7
+ # Select the "Recognize Face" option
8
+ stt.test_input("Select Option", "Recognize Face")
9
+
10
+ # Upload an image for face recognition
11
+ stt.test_input("Upload Image", "path_to_image.jpg")
12
+
13
+ # Click the "Recognize Face" button
14
+ stt.test_input("Recognize Face")
15
+
16
+ # Verify the recognition result
17
+ stt.test_output("It's a picture of John Doe! Insta handle: <a href='https://www.instagram.com/johndoe123/' target='_blank'><font color='red'>johndoe123</font></a>")
18
+
19
+ # Clean up
20
+ stt.test_runner.cleanup()
21
+
22
+ test_recognize_face()