Exemplo n.º 1
0
 def test_update_audio_book(self):
     req_data = {
         "title": "hight",
         "author": "dan",
         "narrator": "narrator",
         "duration": 123456
     }
     s = AudioBook(**req_data)
     self.db.session.add(s)
     self.db.session.commit()
     uploaded_time = datetime.now()
     file_path = Path("tests/utils/littleaudio.wav")
     resp = AudioBookService.update(s.id, file_path, uploaded_time)
     self.assertIsNotNone(resp[0]["audiobook"]["uploaded_time"])
Exemplo n.º 2
0
 def test_reject_update_given_unknown_id(self):
     uploaded_time = datetime.now()
     file_path = Path("tests/utils/littleaudio.wav")
     resp = AudioBookService.update(10020, file_path, uploaded_time)
     self.assertEquals(resp[1], 404)