042a1d4773
* introduced central package registry by package init function * dynamic registration of routes, model, migrations and initializers. * setting a docker compose project name to prevent shutdown of other containers with the same (composer)name * ai documentation * app template * Create tests for ALL API entpoints in ALL packages Based on current data. Ensure that all API endpoints used in frontend are tested. These tests are crucial for the next refactoring tasks. * adopting agent instructions for a more consistent coding style * added desired module layout and debugging information * Fix All Failing tests All failing tests are fixed now that makes the refactoring more easy since all tests must pass * restored routes for maintenance * added common translations * added new tests for API Endpoint * Merge branch 'separate_business_logic' * added lern and skill improvement cost editing * Set Docker image tag when building to prevent rebuild when nothing has changed * add and remove PP for Weaponskill fixed * add and remove PP for same named skills fixed * add new task
31 lines
827 B
Go
31 lines
827 B
Go
package gsmaster
|
|
|
|
import (
|
|
"bamort/database"
|
|
"bamort/bmrt/models"
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// GenerateFilename generates a filename based on the prefix and the current date/time
|
|
func generateFilename(prefix string, extension string) string {
|
|
// Get the current date and time
|
|
now := time.Now()
|
|
|
|
// Format the date and time as "YYYY-MM-DD_HH-MM-SS"
|
|
//timestamp = now.Format("2006-01-02_15-04-05")
|
|
timestamp := now.Format("20060102_150405")
|
|
|
|
// Combine the prefix and the timestamp to form the filename
|
|
return fmt.Sprintf("%s_%s.%s", prefix, timestamp, extension)
|
|
}
|
|
|
|
func TestMigrateStructure(t *testing.T) {
|
|
database.SetupTestDB(true) // Use in-memory SQLite for testing
|
|
err := models.MigrateStructure()
|
|
assert.NoError(t, err, "expected no Error during MigrateStructure")
|
|
}
|