<commit_before>import unittest, os
from sightengine.client import SightengineClient

class Tests(unittest.TestCase):
    def test_nudityModel(self):
        client = SightengineClient('1234', 'test')
        checkNudity = client.check('nudity')

        output = checkNudity.image('https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg')
        self.assertEqual('success', output['status'])

        output2 = checkNudity.image('https://incorrectUrl.jpg')
        self.assertEqual('failure', output2['status'])
        self.assertEqual('media_error', output2['error']['type'])

        image = os.path.join(os.path.dirname(__file__), 'assets', 'image.jpg')

        output3 = checkNudity.image(image)
        self.assertEqual('success', output3['status'])

    def test_allModel(self):
        client = SightengineClient('test', 'test')
        checkNudity = client.check('nudity','wad','properties','type','face')

        output = checkNudity.image('https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg')
        self.assertEqual('success', output['status'])

        output2 = checkNudity.image('https://incorrectUrl.jpg')
        self.assertEqual('failure', output2['status'])
        self.assertEqual('media_error', output2['error']['type'])

        image = os.path.join(os.path.dirname(__file__), 'assets', 'image.jpg')

        output3 = checkNudity.image(image)
        self.assertEqual('success', output3['status'])

    def test_feedback(self):
        client = SightengineClient('test', 'test')

        feedback1 = client.feedback('nudity', 'raw', 'https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg')
        self.assertEqual('success', feedback1['status'])

        image = os.path.join(os.path.dirname(__file__), 'assets', 'image.jpg')
        feedback2 = client.feedback('nudity', 'safe', image)
        self.assertEqual('success', feedback2['status'])

        feedback3 = client.feedback('nudity', 'raw', 'https://incorrectUrl.jpg')
        self.assertEqual('failure', feedback3['status'])
        self.assertEqual('media_error', feedback3['error']['type'])

        feedback4 = client.feedback('model9999', 'raw', 'https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg')
        self.assertEqual('failure', feedback4['status'])
        self.assertEqual('argument_error', feedback4['error']['type'])

        feedback4 = client.feedback('nudity', 'raw9999','https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg')
        self.assertEqual('failure', feedback4['status'])
        self.assertEqual('argument_error', feedback4['error']['type'])

if __name__ == '__main__':
    unittest.main()<commit_msg>change image url in tests.py<commit_after>import unittest, os
from sightengine.client import SightengineClient

class Tests(unittest.TestCase):
    def test_nudityModel(self):
        client = SightengineClient('1234', 'test')
        checkNudity = client.check('nudity')

        output = checkNudity.image('https://sightengine.com/assets/img/examples/example5.jpg')
        self.assertEqual('success', output['status'])

        output2 = checkNudity.image('https://incorrectUrl.jpg')
        self.assertEqual('failure', output2['status'])
        self.assertEqual('media_error', output2['error']['type'])

        image = os.path.join(os.path.dirname(__file__), 'assets', 'image.jpg')

        output3 = checkNudity.image(image)
        self.assertEqual('success', output3['status'])

    def test_allModel(self):
        client = SightengineClient('1234', 'test')
        checkNudity = client.check('nudity','wad','properties','type','face')

        output = checkNudity.image('https://sightengine.com/assets/img/examples/example5.jpg')
        self.assertEqual('success', output['status'])

        output2 = checkNudity.image('https://incorrectUrl.jpg')
        self.assertEqual('failure', output2['status'])
        self.assertEqual('media_error', output2['error']['type'])

        image = os.path.join(os.path.dirname(__file__), 'assets', 'image.jpg')

        output3 = checkNudity.image(image)
        self.assertEqual('success', output3['status'])

    def test_feedback(self):
        client = SightengineClient('1234', 'test')

        feedback1 = client.feedback('nudity', 'raw', 'https://d3m9459r9kwism.cloudfront.net/img/examples/example5.jpg')
        self.assertEqual('success', feedback1['status'])

        image = os.path.join(os.path.dirname(__file__), 'assets', 'image.jpg')
        feedback2 = client.feedback('nudity', 'safe', image)
        self.assertEqual('success', feedback2['status'])

        feedback3 = client.feedback('nudity', 'raw', 'https://incorrectUrl.jpg')
        self.assertEqual('failure', feedback3['status'])
        self.assertEqual('media_error', feedback3['error']['type'])

        feedback4 = client.feedback('model9999', 'raw', 'https://sightengine.com/assets/img/examples/example5.jpg')
        self.assertEqual('failure', feedback4['status'])
        self.assertEqual('argument_error', feedback4['error']['type'])

        feedback4 = client.feedback('nudity', 'raw9999','https://sightengine.com/assets/img/examples/example5.jpg')
        self.assertEqual('failure', feedback4['status'])
        self.assertEqual('argument_error', feedback4['error']['type'])

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.16844669289863218, 'fraction_numerical': 0.023234026606707887, 'mean_word_length': 3.9609665427509295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1126800', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1550, 'n_words': 217}