-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_identifier.py
55 lines (31 loc) · 1.14 KB
/
test_identifier.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import unittest
from unittest.mock import patch
import identifier
class TestIdentifier(unittest.TestCase):
#is_image_file method
# Valid Image File
def test_is_image_file(self):
file_name = "image.jpg"
self.assertTrue(identifier.is_image_file(file_name))
# Not Valid Image File
def test_not_image_file(self):
file_name = "music.mp3"
self.assertFalse(identifier.is_image_file(file_name))
# File with No Extension
def test_no_extension_file(self):
file_name = "file"
self.assertFalse(identifier.is_image_file(file_name))
#get_faces_data method
"""
def test_have_directory(self):
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
image_dir = os.path.join(BASE_DIR, 'faces')
known_encodings = []
known_names = []
with open('scanned-faces', 'rt') as f:
scanned = f.readlines()
scanned = [i.split('\n')[0] for i in scanned]
self.assertTrue(identifier.get_faces_data("ab"))
"""
if __name__ == '__main__':
unittest.main()