Improved code quality.
This commit is contained in:
parent
6afef2cd43
commit
408ebc3236
14
README.md
14
README.md
|
@ -8,21 +8,21 @@
|
|||
[![License](https://img.shields.io/pypi/l/python-benedict.svg)](https://img.shields.io/pypi/l/python-benedict.svg)
|
||||
|
||||
# python-benedict
|
||||
python-benedict is the Python dictionary for humans dealing with evil data.
|
||||
python-benedict is the Python dictionary for humans dealing with evil/complex data.
|
||||
|
||||
## Features
|
||||
- Full **keypath** support *(using the dot syntax)*
|
||||
- Many **utility methods** to retrieve data as needed *(all methods listed below)*
|
||||
- 100% **backward-compatible** *(you can replace existing dicts without pain)*
|
||||
- Full **keypath** support *(using the dot syntax)*
|
||||
- Many **utility methods** to retrieve data as needed *(all methods listed below)*
|
||||
- 100% **backward-compatible** *(you can replace existing dicts without pain)*
|
||||
|
||||
## Requirements
|
||||
- Python 3.4, 3.5, 3.6, 3.7
|
||||
- Python 3.4, 3.5, 3.6, 3.7
|
||||
|
||||
## Installation
|
||||
- Run `pip install python-benedict`
|
||||
- Run `pip install python-benedict`
|
||||
|
||||
## Testing
|
||||
- Run `tox` / `python setup.py test`
|
||||
- Run `tox` / `python setup.py test`
|
||||
|
||||
## Usage
|
||||
`benedict` is a dict subclass, so it is possible to use it as a normal dict *(you can just cast an existing dict)*.
|
||||
|
|
|
@ -5,7 +5,7 @@ python-benedict
|
|||
===============
|
||||
|
||||
python-benedict is the Python dictionary for humans dealing with
|
||||
evil data.
|
||||
evil/complex data.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
__author__ = 'Fabio Caccamo'
|
||||
__copyright__ = 'Copyright (c) 2019 Fabio Caccamo'
|
||||
__description__ = 'python-benedict is the Python dictionary for humans dealing with evil data.'
|
||||
__description__ = 'python-benedict is the Python dictionary for humans dealing with evil/complex data.'
|
||||
__license__ = 'MIT'
|
||||
__title__ = 'benedict'
|
||||
__version__ = '0.2.0'
|
|
@ -140,7 +140,7 @@ class BenedictKeypathDictTestCase(unittest.TestCase):
|
|||
}
|
||||
b = benedict(d)
|
||||
with self.assertRaises(KeyError):
|
||||
val = b['b']
|
||||
b['b']
|
||||
|
||||
def test_getitem_with_1_not_str_key(self):
|
||||
d = {
|
||||
|
@ -152,7 +152,7 @@ class BenedictKeypathDictTestCase(unittest.TestCase):
|
|||
self.assertEqual(b[None], None)
|
||||
self.assertEqual(b[False], False)
|
||||
with self.assertRaises(KeyError):
|
||||
val = b[True]
|
||||
b[True]
|
||||
self.assertEqual(b[0], 0)
|
||||
|
||||
def test_get_with_2_valid_keys(self):
|
||||
|
@ -190,7 +190,7 @@ class BenedictKeypathDictTestCase(unittest.TestCase):
|
|||
}
|
||||
b = benedict(d)
|
||||
with self.assertRaises(KeyError):
|
||||
val = b['b.a']
|
||||
b['b.a']
|
||||
|
||||
def test_get_with_3_valid_keys(self):
|
||||
d = {
|
||||
|
@ -235,7 +235,7 @@ class BenedictKeypathDictTestCase(unittest.TestCase):
|
|||
}
|
||||
b = benedict(d)
|
||||
with self.assertRaises(KeyError):
|
||||
val = b['c.b.a']
|
||||
b['c.b.a']
|
||||
|
||||
def test_has_with_1_key(self):
|
||||
d = {
|
||||
|
|
Loading…
Reference in New Issue