Exemplo n.º 1
0
    def test_simple(self):
        with TestClient(self.app) as client:
            response = client.post("/", json={"inputs": "This is some text"})

        self.assertEqual(
            response.status_code,
            200,
        )
        self.assertEqual(response.header["content-type"], "audio/wav")
        audio = ffmpeg_read(response.content)
        self.assertEqual(audio.shape, (10, ))
    def test_simple(self):
        with TestClient(self.app) as client:
            response = client.post("/", json={"inputs": "This is some text"})

        self.assertEqual(
            response.status_code,
            200,
        )
        self.assertEqual(response.headers["content-type"], "audio/flac")
        audio = ffmpeg_read(response.content)
        self.assertEqual(len(audio.shape), 1)
        self.assertGreater(audio.shape[0], 1000)
    def test_webm_audiofile(self):
        bpayload = self.read("sample1.webm")

        with TestClient(self.app) as client:
            response = client.post("/", data=bpayload)

        self.assertEqual(
            response.status_code,
            200,
        )
        self.assertEqual(response.header["content-type"], "audio/wav")
        audio = ffmpeg_read(response.content)
        self.assertEqual(audio.shape, (10, ))
    def test_simple(self):
        bpayload = self.read("sample1.flac")

        with TestClient(self.app) as client:
            response = client.post("/", data=bpayload)

        self.assertEqual(
            response.status_code,
            200,
        )
        self.assertEqual(response.headers["content-type"], "audio/flac")
        audio = ffmpeg_read(response.content)

        self.assertEqual(len(audio.shape), 1)
        self.assertGreater(audio.shape[0], 1000)