feat(database): tests
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m18s
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m18s
- now the test against 25 char id length
This commit is contained in:
parent
f70879cf8d
commit
0f1e6c6aaa
@ -81,7 +81,7 @@ func TestCreateScrapeHistory(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validScrapeHistory := models.ScrapeHistory{
|
validScrapeHistory := models.ScrapeHistory{
|
||||||
ScrapeTaskID: "valid_task_id",
|
ScrapeTaskID: "000000000000valid_task_id",
|
||||||
UserSourceID: validUSerSource.ID,
|
UserSourceID: validUSerSource.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ func TestGetScrapeHistoryByID(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validScrapeHistory := models.ScrapeHistory{
|
validScrapeHistory := models.ScrapeHistory{
|
||||||
ScrapeTaskID: "valid_task_id",
|
ScrapeTaskID: "000000000000valid_task_id",
|
||||||
UserSourceID: validUSerSource.ID,
|
UserSourceID: validUSerSource.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ func TestGetScrapeHistoryByID(t *testing.T) {
|
|||||||
id models.ScrapeTaskID
|
id models.ScrapeTaskID
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
{"Valid ID", "valid_task_id", false},
|
{"Valid ID", "000000000000valid_task_id", false},
|
||||||
{"Empty ID", "", true},
|
{"Empty ID", "", true},
|
||||||
{"Non-existent ID", "non_existent_id", true},
|
{"Non-existent ID", "non_existent_id", true},
|
||||||
}
|
}
|
||||||
@ -279,7 +279,7 @@ func TestUpdateScrapeHistory(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validScrapeHistory := models.ScrapeHistory{
|
validScrapeHistory := models.ScrapeHistory{
|
||||||
ScrapeTaskID: "valid_task_id",
|
ScrapeTaskID: "000000000000valid_task_id",
|
||||||
UserSourceID: validUSerSource.ID,
|
UserSourceID: validUSerSource.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ func TestDeleteScrapeHistory(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validScrapeHistory := models.ScrapeHistory{
|
validScrapeHistory := models.ScrapeHistory{
|
||||||
ScrapeTaskID: "valid_task_id",
|
ScrapeTaskID: "000000000000valid_task_id",
|
||||||
UserSourceID: validUSerSource.ID,
|
UserSourceID: validUSerSource.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ func TestDeleteScrapeHistory(t *testing.T) {
|
|||||||
id models.ScrapeTaskID
|
id models.ScrapeTaskID
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
{"Valid ID", "valid_task_id", false},
|
{"Valid ID", "000000000000valid_task_id", false},
|
||||||
{"Empty ID", "", true},
|
{"Empty ID", "", true},
|
||||||
{"Short ID", "short_id", true},
|
{"Short ID", "short_id", true},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user