-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: make_rule function * test: make_rule function test * test: added make_rules function tests * docs: added make_rule function into online docs * chore: remove orphan md file
- Loading branch information
1 parent
19c60f8
commit 2cf1f3b
Showing
5 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from missil import make_rule | ||
from missil import make_rules | ||
from missil.rules import Area | ||
from missil.rules import Rule | ||
|
||
|
||
def test_make_rule(bearer_token): | ||
test_area = make_rule(bearer_token, "test") | ||
assert test_area.name == "test" | ||
assert isinstance(test_area, Area) | ||
assert isinstance(test_area.READ, Rule) | ||
assert isinstance(test_area.WRITE, Rule) | ||
|
||
|
||
def test_make_rules_single_ba(bearer_token): | ||
test_area = make_rules(bearer_token, "test_1") | ||
assert "test_1" in test_area | ||
assert isinstance(test_area["test_1"], Area) | ||
assert isinstance(test_area["test_1"].READ, Rule) | ||
assert isinstance(test_area["test_1"].WRITE, Rule) | ||
|
||
|
||
def test_make_rules_multiple_bas(bearer_token): | ||
test_areas = make_rules(bearer_token, "test_1", "test_2") | ||
assert "test_1" in test_areas | ||
assert "test_2" in test_areas | ||
assert isinstance(test_areas["test_1"], Area) | ||
assert isinstance(test_areas["test_2"], Area) | ||
assert isinstance(test_areas["test_1"].READ, Rule) | ||
assert isinstance(test_areas["test_2"].READ, Rule) | ||
assert isinstance(test_areas["test_1"].WRITE, Rule) | ||
assert isinstance(test_areas["test_2"].WRITE, Rule) |