Ejemplo n.º 1
0
    def test_process_single_image(self):
        self.save_picture()
        mood_service = MoodService()
        mood_process = mood_service.perfom_mood_detection("12345")
        mood_process_get = mood_service.get_mood("12345")

        self.assertEqual(1, len(mood_process.faces))
        self.assertEqual(1, len(mood_process_get.faces))
        self.assertEqual(mood_process.faces[0].mood, mood_process_get.faces[0].mood)
Ejemplo n.º 2
0
    def test_process_single_image(self):
        self.save_picture()
        mood_service = MoodService()
        mood_process = mood_service.perfom_mood_detection("12345")
        mood_process_get = mood_service.get_mood("12345")

        self.assertEqual(1, len(mood_process.faces))
        self.assertEqual(1, len(mood_process_get.faces))
        self.assertEqual(mood_process.faces[0].mood,
                         mood_process_get.faces[0].mood)
Ejemplo n.º 3
0
class Mood(Resource):
    def __init__(self):
        self.mood_service = MoodService()

    def get(self, uid):
        mood_process = self.mood_service.get_mood(uid)
        return mood_process.to_json()

    def put(self, uid):
        mood_process = self.mood_service.perfom_mood_detection(uid)
        return mood_process.to_json()
Ejemplo n.º 4
0
class Mood(Resource):

    def __init__(self):
        self.mood_service = MoodService()

    def get(self, uid):
        mood_process = self.mood_service.get_mood(uid)
        return mood_process.to_json()

    def put(self, uid):
        mood_process = self.mood_service.perfom_mood_detection(uid)
        return mood_process.to_json()
Ejemplo n.º 5
0
 def __init__(self):
     self.mood_service = MoodService()
Ejemplo n.º 6
0
    def test_get_mood_process(self):
        self.save_picture()

        mood_service = MoodService()
        mood_process = mood_service.get_mood("12345")
        self.assertEqual(2, len(mood_process.faces))
Ejemplo n.º 7
0
    def test_get_mood_process(self):
        self.save_picture()

        mood_service = MoodService()
        mood_process = mood_service.get_mood("12345")
        self.assertEqual(2, len(mood_process.faces))
Ejemplo n.º 8
0
 def __init__(self):
     self.mood_service = MoodService()