have simulacradata tests clean up generated files

This commit is contained in:
Matthew Jaffee 2022-01-17 09:39:28 -06:00
parent 80f9ddaa02
commit e297a6775d
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View file

@ -20,3 +20,4 @@ launch.json
__pycache__/
report.xml
outputs.json
builds/

View file

@ -2,12 +2,14 @@
package main
import (
"os"
"testing"
)
const testRecords int = 1000
func TestAge(t *testing.T) {
defer os.Remove("age.csv")
err := GenerateAgeField(testRecords)
if err != nil {
t.Fatalf("%v", err)
@ -15,13 +17,15 @@ func TestAge(t *testing.T) {
}
func TestIP(t *testing.T) {
defer os.Remove("ip.csv")
err := GenerateIPField(testRecords)
if err != nil {
t.Fatalf("%v", err)
}
}
func TestIndentifer(t *testing.T) {
func TestIdentifier(t *testing.T) {
defer os.Remove("identifier.csv")
err := GenerateArbIdField(testRecords)
if err != nil {
t.Fatalf("%v", err)
@ -29,6 +33,7 @@ func TestIndentifer(t *testing.T) {
}
func TestOptIn(t *testing.T) {
defer os.Remove("optin.csv")
err := GenerateOptInField(testRecords)
if err != nil {
t.Fatalf("%v", err)
@ -36,6 +41,7 @@ func TestOptIn(t *testing.T) {
}
func TestCountry(t *testing.T) {
defer os.Remove("country.csv")
err := GenerateCountryField(testRecords)
if err != nil {
t.Fatalf("%v", err)
@ -43,6 +49,7 @@ func TestCountry(t *testing.T) {
}
func TestTime(t *testing.T) {
defer os.Remove("time.csv")
err := GenerateTimeField(testRecords)
if err != nil {
t.Fatalf("%v", err)