#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import unittest

from voicetext import VoiceText, VoiceTextException


class VoiceTextTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.vt = VoiceText("YOUR_API_KEY")

    def setUp(self):
        self.vt.restore_default()

    def test_speak(self):
        self.vt.speak("こんにちは。")

    def test_speak_speakers(self):
        self.vt.speaker("show").speak("ショウです。")
        self.vt.speaker("haruka").speak("ハルカです。")
        self.vt.speaker("hikari").speak("ヒカリです。")
        self.vt.speaker("takeru").speak("タケルです。")
        self.vt.speaker("santa").speak("サンタです。")
        self.vt.speaker("bear").speak("熊です。")

    def test_speak_emotions(self):
        self.vt.emotion("happiness").speak("喜び。")
        self.vt.emotion("anger").speak("怒り。")
        self.vt.emotion("sadness").speak("悲しみ。")

    def test_speak_pitches(self):
        for p in range(50, 201, 50):
            self.vt.pitch(p).speak("ピッチ%d" % p)

    def test_speak_speeds(self):
        for s in range(50, 401, 50):
            self.vt.speed(s).speak("スピード%d" % s)

    def test_speak_volumes(self):
        for v in range(50, 201, 50):
            self.vt.volume(v).speak("ボリューム%d" % v)


if __name__ == "__main__":
    unittest.main()

@@ -18,116 +18,9 @@
 thon
-%0A# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, division, print_function, unicode_literals%0A
+3
 %0Aimp
@@ -68,28 +68,8 @@
 Text
-, VoiceTextException
 %0A%0A%0Ac
@@ -161,16 +161,17 @@
     cls.
+_
 vt = Voi
@@ -228,16 +228,17 @@
    self.
+_
 vt.resto
@@ -282,32 +282,33 @@
 ):%0A        self.
+_
 vt.speak(%22%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%82
@@ -351,32 +351,33 @@
 ):%0A        self.
+_
 vt.speaker(%22show
@@ -374,16 +374,34 @@
 aker
-(
+ = 
 %22show%22
-)
+%0A        self._vt
 .spe
@@ -418,32 +418,33 @@
 %22)%0A        self.
+_
 vt.speaker(%22haru
@@ -441,17 +441,19 @@
 aker
-(
+ = 
 %22haruka%22
 ).sp
@@ -448,17 +448,33 @@
 %22haruka%22
-)
+%0A        self._vt
 .speak(%22
@@ -487,32 +487,33 @@
 %22)%0A        self.
+_
 vt.speaker(%22hika
@@ -510,17 +510,19 @@
 aker
-(
+ = 
 %22hikari%22
 ).sp
@@ -517,17 +517,33 @@
 %22hikari%22
-)
+%0A        self._vt
 .speak(%22
@@ -556,32 +556,33 @@
 %22)%0A        self.
+_
 vt.speaker(%22take
@@ -579,17 +579,19 @@
 aker
-(
+ = 
 %22takeru%22
 ).sp
@@ -586,17 +586,33 @@
 %22takeru%22
-)
+%0A        self._vt
 .speak(%22
@@ -625,32 +625,33 @@
 %22)%0A        self.
+_
 vt.speaker(%22sant
@@ -648,17 +648,35 @@
 aker
-(
+ = 
 %22santa%22
-)
+%0A        self._vt
 .spe
@@ -697,24 +697,25 @@
        self.
+_
 vt.speaker(%22
@@ -716,16 +716,34 @@
 aker
-(
+ = 
 %22bear%22
-)
+%0A        self._vt
 .spe
@@ -794,32 +794,33 @@
 ):%0A        self.
+_
 vt.emotion(%22happ
@@ -813,17 +813,19 @@
 .emotion
-(
+ = 
 %22happine
@@ -823,25 +823,41 @@
  %22happiness%22
-)
+%0A        self._vt
 .speak(%22%E5%96%9C%E3%81%B3%E3%80%82%22
@@ -863,32 +863,33 @@
 %22)%0A        self.
+_
 vt.emotion(%22ange
@@ -886,17 +886,35 @@
 tion
-(
+ = 
 %22anger%22
-)
+%0A        self._vt
 .spe
@@ -936,16 +936,17 @@
    self.
+_
 vt.emoti
@@ -947,17 +947,19 @@
 .emotion
-(
+ = 
 %22sadness
@@ -959,17 +959,33 @@
 sadness%22
-)
+%0A        self._vt
 .speak(%22
@@ -1084,16 +1084,17 @@
 elf.
+_
 vt.pitch
 (p).
@@ -1093,11 +1093,33 @@
 itch
-(p)
+ = p%0A            self._vt
 .spe
@@ -1226,16 +1226,17 @@
 elf.
+_
 vt.speed
 (s).
@@ -1235,11 +1235,33 @@
 peed
-(s)
+ = s%0A            self._vt
 .spe
@@ -1366,16 +1366,17 @@
    self.
+_
 vt.volum
@@ -1380,11 +1380,33 @@
 lume
-(v)
+ = v%0A            self._vt
 .spe

update test