add unit/integrted tests for dpc

write something like this (https://docs.python.org/3.3/tutorial/errors.html)
```python
try:
    f = open('myfile.txt')
    s = f.readline()
    i = int(s.strip())
except IOError as err:
    print("I/O error: {0}".format(err))
except ValueError:
    print("Could not convert data to an integer.")
except:
    print("Unexpected error:", sys.exc_info()[0])
    raise
```
The last except clause may omit the exception name(s), to serve as a wildcard.