Reformat the source code using black

Change-Id: I54e7f6b9a60e4caa42158bf6259c671bc800e4a8
diff --git a/tox.ini b/tox.ini
index 2cb7d3b..0ee1b02 100644
--- a/tox.ini
+++ b/tox.ini
@@ -25,6 +25,12 @@
 # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
 minversion = 3.2.0
 
+[defs]
+pyfiles =
+  src
+  tests
+  unit_tests
+
 [testenv]
 setenv = VIRTUAL_ENV={envdir}
          PYTHONHASHSEED=0
@@ -146,7 +152,14 @@
 commands =
     functest-run-suite --keep-model --bundle {posargs}
 
-[flake8]
-# Ignore E902 because the unit_tests directory is missing in the built charm.
-ignore = E402,E226,W503,W504,E902
-max-line-length = 100
+[testenv:black-reformat]
+deps =
+  black >= 22, < 23
+commands =
+  black {[defs]pyfiles}
+
+[testenv:black]
+deps =
+  black >= 22, < 23
+commands =
+  black --check {[defs]pyfiles}