Skip to content

Commit 0124afe

Browse files
author
agrandiere
committed
Merge branch 'dev'
2 parents 05de887 + e19d279 commit 0124afe

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
language: python
22
python:
3+
- "2.6"
4+
- "2.7"
5+
- "3.3"
6+
- "3.4"
7+
- "3.5"
38
- "3.6"
49

510
install:
6-
- pip install
11+
- pip install requests
712
script:
813
- python tests.py

examples/nudity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from sightengine.client import SightengineClient
22

3-
client = SightengineClient('API user', 'API secret')
3+
client = SightengineClient('test', 'test')
44

55
##### feedback
66

tests.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
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()

0 commit comments

Comments
 (0)