Skip to content

Commit

Permalink
fix(model): use underscores instead of dashes as a separator for the …
Browse files Browse the repository at this point in the history
…store file
  • Loading branch information
rhamzeh committed Sep 6, 2023
1 parent e43d7d2 commit f4dfdc0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ The tests file should be in yaml and have the following format:
```yaml
---
name: Store Name # store name, optional
# model-file: ./model.fga # a global model that would apply to all tests, optional
# model_file: ./model.fga # a global model that would apply to all tests, optional
# model can be used instead of model-file, optional
model: |
model
Expand Down Expand Up @@ -469,7 +469,7 @@ tests: # required
can_view: true
can_write: true
can_share: false
list-objects: # a set of list objects to run
list_objects: # a set of list objects to run
- user: user:anne
type: folder
assertions:
Expand All @@ -493,7 +493,7 @@ tests: # required
assertions:
# a set of expected results for each relation
can_view: true
list-objects:
list_objects:
- user: user:anne
type: folder
assertions:
Expand Down
4 changes: 2 additions & 2 deletions example/tests.fga.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: FolderBox # store name
model-file: ./model.fga # a global model that would apply to all tests
model_file: ./model.fga # a global model that would apply to all tests
# model can be used instead of model_file
#model: |
# model
Expand Down Expand Up @@ -45,7 +45,7 @@ tests:
can_view: true
can_write: true
can_share: false
list-objects: # Each check test is made of: a user, an object type and the expected result for one or more relations
list_objects: # Each check test is made of: a user, an object type and the expected result for one or more relations
- user: user:anne
type: folder
assertions:
Expand Down
4 changes: 2 additions & 2 deletions internal/storetest/storedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ type ModelTest struct {
Description string `json:"description" yaml:"description"`
Tuples []client.ClientTupleKey `json:"tuples" yaml:"tuples"`
Check []ModelTestCheck `json:"check" yaml:"check"`
ListObjects []ModelTestListObjects `json:"list_objects" yaml:"list-objects"` //nolint:tagliatelle
ListObjects []ModelTestListObjects `json:"list_objects" yaml:"list_objects"` //nolint:tagliatelle
}

type StoreData struct {
Name string `json:"name" yaml:"name"`
Model string `json:"model" yaml:"model"`
ModelFile string `json:"model_file" yaml:"model-file"` //nolint:tagliatelle
ModelFile string `json:"model_file" yaml:"model_file"` //nolint:tagliatelle
Tuples []client.ClientTupleKey `json:"tuples" yaml:"tuples"`
Tests []ModelTest `json:"tests" yaml:"tests"`
}
Expand Down

0 comments on commit f4dfdc0

Please sign in to comment.