File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 11language : python
22python :
3+ - " 2.6"
4+ - " 2.7"
5+ - " 3.3"
6+ - " 3.4"
7+ - " 3.5"
38 - " 3.6"
49
510install :
6- - pip install
11+ - pip install requests
712script :
813 - python tests.py
Original file line number Diff line number Diff line change 11from sightengine .client import SightengineClient
22
3- client = SightengineClient ('API user ' , 'API secret ' )
3+ client = SightengineClient ('test ' , 'test ' )
44
55##### feedback
66
Original file line number Diff line number Diff line change 1- pass
1+ import unittest
2+ from sightengine .client import SightengineClient
3+
4+ class Tests (unittest .TestCase ):
5+ def test_nudity (self ):
6+ client = SightengineClient ('test' , 'test' )
7+ checkNudity = client .check ('nudity' )
8+
9+ output = checkNudity .image ('https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg' )
10+
11+ self .assertEqual ('success' , output ['status' ])
12+
13+ output2 = checkNudity .image ('https://incorrectUrl.jpg' )
14+
15+ self .assertEqual ('failure' , output2 ['status' ])
16+ self .assertEqual ('media_error' , output2 ['error' ]['type' ])
17+
18+
19+ if __name__ == '__main__' :
20+ unittest .main ()
You can’t perform that action at this time.
0 commit comments