**Is your feature request related to a problem? Please describe.** Currently, some files code quality is very low, needed to be improved. **Describe the solution you'd like** - Reading Codacy review report in [here](https://app.codacy.com/app/NashMiao/ontology-python-sdk/file/36003100998/duplication/source?bid=10458533&fileBranchId=10458533). - Refactor code in [here](https://github.com/ontio/ontology-python-sdk/blob/master/tests/test_ontid.py) and [here](https://github.com/ontio/ontology-python-sdk/blob/master/tests/test_aio_ontid.py).