<commit_before>package dueros

import (
	"encoding/base64"
	"fmt"
	"io/ioutil"
	"os"
	"testing"
)

var apiKey string = "<KEY>"
var apiSecret string = "<KEY>"

func TestDefaultAuthorizer_Authorize(t *testing.T) {
	client := NewVoiceClient(apiKey, apiSecret)
	if err := client.auth(); err != nil {
		t.Fatal(err)
	}
	if client.AccessToken == "" {
		t.Error("获取access_token失败")
	}
	fmt.Println(client.AccessToken)
	t.Log("testing passed.")
}

func TestDefaultAuthorizer_Authorize_fail(t *testing.T) {
	client := NewVoiceClient("", apiSecret)
	if err := client.auth(); err != nil {
		t.Log(err)
	}
	t.Log("testing passed.")
}

func TestVoiceClient_TextToSpeech(t *testing.T) {<commit_msg>modify apiKey & apiSecret<commit_after>package dueros

import (
	"encoding/base64"
	"fmt"
	"io/ioutil"
	"os"
	"testing"
)

var apiKey string = "<KEY>"
var apiSecret string = "<KEY>"

func TestDefaultAuthorizer_Authorize(t *testing.T) {
	client := NewVoiceClient(apiKey, apiSecret)
	if err := client.auth(); err != nil {
		t.Fatal(err)
	}
	if client.AccessToken == "" {
		t.Error("获取access_token失败")
	}
	fmt.Println(client.AccessToken)
	t.Log("testing passed.")
}

func TestDefaultAuthorizer_Authorize_fail(t *testing.T) {
	client := NewVoiceClient("", apiSecret)
	if err := client.auth(); err != nil {
		t.Log(err)
	}
	t.Log("testing passed.")
}

func TestVoiceClient_TextToSpeech(t *testing.T) {
{'fraction_non_alphanumeric': 0.16014492753623188, 'fraction_numerical': 0.002898550724637681, 'mean_word_length': 4.802521008403361, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '4758639', 'n_tokens_mistral': 541, 'n_tokens_neox': 532, 'n_words': 104}