Skip to content

Commit

Permalink
Unstable json ordering fix for py 3.7dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kolotaev committed Apr 24, 2019
1 parent d1162e7 commit bd8646a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ If the existing Rules are not enough for you, feel free to define your [own](./e
| ------------- |-------------|-------------|-------------|
| Equal | `'name': Equal('max', ci=True)` | `'name': 'Max'`| Aliased as `StrEqual`. Use instead of `Eq` it you want string-type check and case-insensitivity |
| PairsEqual | `'names': PairsEqual()` | `'names': ['Bob', 'Bob']`| Aliased as `StrPairsEqual` |
| RegexMatch | `'file': RegexMatch(r'\.rb$')` | `'file': 'test.rb'`| Supports case-insensitivity |
| RegexMatch | `'file': RegexMatch(r'\.rb$')` | `'file': 'test.rb'`| |
| StartsWith | `'file': StartsWith('logs-')` | `'file': 'logs-data-101967.log'`| Supports case-insensitivity |
| EndsWith | `'file': EndsWith('.log')` | `'file': 'logs-data-101967.log'`| Supports case-insensitivity |
| Contains | `'file': Contains('sun')` | `'file': 'observations-sunny-days.csv'`| Supports case-insensitivity |
Expand Down
4 changes: 2 additions & 2 deletions tests/test_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def test_json_roundtrip_of_a_policy_with_context():
@pytest.mark.parametrize('policy', [
Policy(1, subjects=[{'name': Eq('Max'), 'rate': Greater(90)}], actions=[Eq('get'), Eq('post')], resources=[Any()]),
Policy(2, subjects=[{'login': Eq('sally')}], actions=[Eq('get'), Eq('post')], context={'ip': Eq('127.0.0.1')}),
Policy(3, subjects=[{'login': AnyIn('sally', 'patric')}], actions=[And(Eq('get'), Eq('post'))]),
Policy(4, subjects=[{'login': AnyIn('sally', 'patric')}], actions=[And(Eq('get'), Eq('post'))]),
Policy(3, subjects=[{'rating': AnyIn(1, 2)}], actions=[And(Eq('get'), Eq('post'))]),
Policy(4, subjects=[{'rating': AnyIn(1, 2)}], actions=[And(Eq('get'), Eq('post'))]),
Policy(5, actions=[Eq('get')]),
])
def test_json_roundtrip_of_a_rules_based_policy(policy):
Expand Down

0 comments on commit bd8646a

Please sign in to comment.