<commit_before>package models

import (
	"testing"
	"time"

	"github.com/antihax/goesi"
)

func TestAssetSetup(t *testing.T) {
	database.Exec(`
			INSERT INTO evedata.assets (60012526, 1373, 2, 1001, "station", 11, "somewhere", 0);
			INSERT INTO evedata.assets (60012526, 1373, 2, 1001, "station", 12, "somewhere", 0);		
			INSERT INTO evedata.assets (60012526, 1373, 2, 1001, "station", 13, "somewhere", 0);
			INSERT INTO evedata.assets (13, 1373, 2, 1001, "other", 14, "somewhere", 0);
			INSERT INTO evedata.assets (14, 1373, 2, 1001, "other", 15, "somewhere", 0);
		`)

	tok := goesi.CRESTToken{
		AccessToken:  "FAKE",
		RefreshToken: "<PASSWORD>",
		Expiry:       time.Now().UTC().Add(time.Hour * 100000),
		TokenType:    "Bearer"}

	err := AddCRESTToken(1001, 1001, "D<PASSWORD>", &tok, "")
	if err != nil {
		t.Error(err)
		return
	}
}

func TestGetAssetLocations(t *testing.T) {
	_, err := GetAssetLocations(1001, 1)
	if err != nil {
		t.Error(err)
		return
	}
	_, err = GetAssetLocations(1001, 0)
	if err != nil {
		t.Error(err)
		return
	}
}

func TestGetAssetCharacters(t *testing.T) {
	_, err := GetAssetCharacters(1)
	if err != nil {
		t.Error(err)
		return
	}
}

func TestGetAsset(t *testing.T) {
	_, err := GetAssets(1001, 1001, 60012526)
	if err != nil {
		t.Error(err)
		return
	}
}<commit_msg>fix test recursion<commit_after>package models

import (
	"testing"
	"time"

	"github.com/antihax/goesi"
)

func TestAssetSetup(t *testing.T) {
	_, err := database.Exec(`
			INSERT IGNORE INTO evedata.assets VALUES
			 (60012526, 39, 2, 1001, "station", 21, "station", 0)
			,(60012526, 179, 2, 1001, "station", 22, "station", 0)
			,(60012526, 182, 2, 1001, "station", 23, "station", 0)
			,(23, 196, 2, 1001, "other", 24, "other", 0)
			,(23, 199, 2, 1001, "other", 25, "other", 0)
			,(22, 39, 2, 1001, "other", 26, "other", 0);
		`)
	if err != nil {
		t.Error(err)
		return
	}

	tok := goesi.CRESTToken{
		AccessToken:  "FAKE",
		RefreshToken: "<PASSWORD>",
		Expiry:       time.Now().UTC().Add(time.Hour * 100000),
		TokenType:    "Bearer"}

	err = AddCRESTToken(1001, 1001, "Dude", &tok, "")
	if err != nil {
		t.Error(err)
		return
	}
}

func TestGetAssetLocations(t *testing.T) {
	_, err := GetAssetLocations(1001, 1)
	if err != nil {
		t.Error(err)
		return
	}
	_, err = GetAssetLocations(1001, 0)
	if err != nil {
		t.Error(err)
		return
	}
}

func TestGetAssetCharacters(t *testing.T) {
	_, err := GetAssetCharacters(1)
	if err != nil {
		t.Error(err)
		return
	}
}

func TestGetAsset(t *testing.T) {
	data, err := GetAssets(1001, 0, 60012526)
	if err != nil {
		t.Error(err)
		return
	}

	if data[0].CharacterID != 1001 {
		t.Error("wrong character ID")
		return
	}

	data, err = GetAssets(1001, 1001, 60012526)
	if err != nil {
		t.Error(err)
		return
	}

	if data[0].CharacterID != 1001 {
		t.Error("wrong character ID")
		return
	}

}
{'fraction_non_alphanumeric': 0.17394341599720572, 'fraction_numerical': 0.10024449877750612, 'mean_word_length': 3.5750798722044728, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7518805', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1166, 'n_words': 285}