Skip to content

Commit

Permalink
Started to add more tests for get entity
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbdz committed Oct 17, 2024
1 parent 7e07ce9 commit 3e5bd16
Showing 1 changed file with 82 additions and 8 deletions.
90 changes: 82 additions & 8 deletions entity/entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestSetEntity(t *testing.T) {
Version: "latest",
LatestVersion: true,
IsPseudoVersion: true,
AbsPath: "/home/user/.hery/collection/amadla/entity/github.com/AmadlaOrg/Entity@v.0.0.0-",
AbsPath: "/home/user/.hery/collection/amadla/entity/github.com/AmadlaOrg/Entity@v.0.0.0-20240924093300-abcd1234efgh",
Have: true,
Hash: "",
Exist: true,
Expand All @@ -58,7 +58,7 @@ func TestSetEntity(t *testing.T) {
Version: "latest",
LatestVersion: false,
IsPseudoVersion: true,
AbsPath: "/home/user/.hery/amadla/entity/github.com/AmadlaOrg/Entity@v.0.0.0-",
AbsPath: "/home/user/.hery/amadla/entity/github.com/AmadlaOrg/Entity@v.0.0.0-20240924093300-abcd1234efgh",
Have: true,
Hash: "",
Exist: true,
Expand Down Expand Up @@ -107,12 +107,86 @@ func TestGetEntity(t *testing.T) {
hasError bool
}{
{
name: "Valid: entity",
serviceEntities: []Entity{},
inputEntityUri: "github.com/AmadlaOrg/Entity@latest",
expectedEntity: Entity{},
expectedErr: nil,
hasError: false,
name: "Valid: entity",
serviceEntities: []Entity{
{
Id: "97d4b783-f448-483c-8111-380d6082ae1c",
Entity: "github.com/AmadlaOrg/Entity@v0.0.0-20240924093300-abcd1234efgh",
Name: "Entity",
RepoUrl: "https://github.com/AmadlaOrg/Entity",
Origin: "github.com/AmadlaOrg/Entity",
Version: "latest",
LatestVersion: true,
IsPseudoVersion: true,
AbsPath: "/home/user/.hery/collection/amadla/entity/github.com/AmadlaOrg/Entity@v.0.0.0-20240924093300-abcd1234efgh",
Have: true,
Hash: "",
Exist: true,
Schema: &jsonschema.Schema{},
Config: map[string]any{
"name": "Entity",
"description": "The meta Entity definition.",
"category": "General",
"tags": []string{
"main",
"master",
},
},
},
{
Id: "12c4b793-d458-756f-8151-740d6082ae1f",
Entity: "github.com/AmadlaOrg/Entity@v0.0.0-20230924093300-abcd1234efgh",
Name: "Entity",
RepoUrl: "https://github.com/AmadlaOrg/Entity",
Origin: "github.com/AmadlaOrg/Entity",
Version: "latest",
LatestVersion: false,
IsPseudoVersion: true,
AbsPath: "/home/user/.hery/collection/amadla/entity/github.com/AmadlaOrg/Entity@v.0.0.0-20230924093300-abcd1234efgh",
Have: true,
Hash: "",
Exist: true,
Schema: &jsonschema.Schema{},
Config: map[string]any{
"name": "Entity",
"description": "The meta Entity definition.",
"category": "General",
"tags": []string{
"main",
"master",
},
},
},
{
Id: "98d4b682-c758-943c-8911-560d9022ae3c",
Entity: "github.com/AmadlaOrg/QAFixturesEntityMultipleTagVersion@v2.1.0",
Name: "QAFixturesEntityMultipleTagVersion",
RepoUrl: "https://github.com/AmadlaOrg/QAFixturesEntityMultipleTagVersion",
Origin: "github.com/AmadlaOrg/QAFixturesEntityMultipleTagVersion",
Version: "v2.1.0",
LatestVersion: true,
IsPseudoVersion: false,
AbsPath: "/home/user/.hery/amadla/entity/github.com/AmadlaOrg/QAFixturesEntityMultipleTagVersion@v2.1.0",
Have: true,
Hash: "",
Exist: true,
Schema: &jsonschema.Schema{},
Config: map[string]any{
"name": "QAFixturesEntityMultipleTagVersion",
"description": "Entity Multiple Tag Version definitions.",
"category": "QA",
"tags": []string{
"QA",
"fixture",
"test",
},
},
},
},
inputEntityUri: "github.com/AmadlaOrg/Entity@latest",
expectedEntity: Entity{},
expectedErr: nil,
hasError: false,
},
}

Expand Down

0 comments on commit 3e5bd16

Please sign in to comment.