diff options
author | ng0 <ng0@n0.is> | 2019-10-12 18:16:07 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-10-12 18:16:07 +0000 |
commit | a5f5e7ed9b07b902af4438d76087e034abcba9b2 (patch) | |
tree | 6f376f93f1c785103d0b30f54311a0f61d2bdced /src/revocation | |
parent | 8e827de2a1db34dfe15f5f9da2850ca469b5ecc3 (diff) |
format python
Diffstat (limited to 'src/revocation')
-rw-r--r-- | src/revocation/test_local_revocation.py.in | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/revocation/test_local_revocation.py.in b/src/revocation/test_local_revocation.py.in index 4cc6119ca..d73d0a869 100644 --- a/src/revocation/test_local_revocation.py.in +++ b/src/revocation/test_local_revocation.py.in @@ -11,7 +11,7 @@ # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # @@ -39,7 +39,10 @@ elif os.name == 'nt': TEST_CONFIGURATION = "test_revocation.conf" TEST_REVOCATION_EGO = "revoc_test" -get_clean = subprocess.Popen([config, '-c', TEST_CONFIGURATION, '-s', 'PATHS', '-o', 'GNUNET_HOME', '-f'], stdout=subprocess.PIPE) +get_clean = subprocess.Popen([ + config, '-c', TEST_CONFIGURATION, '-s', 'PATHS', '-o', 'GNUNET_HOME', '-f' +], + stdout=subprocess.PIPE) cleandir, x = get_clean.communicate() cleandir = cleandir.decode("utf-8") cleandir = cleandir.rstrip('\n').rstrip('\r') @@ -55,10 +58,15 @@ try: print("Creating an ego " + TEST_REVOCATION_EGO) sys.stdout.flush() sys.stderr.flush() - idc = subprocess.Popen([ident, '-C', TEST_REVOCATION_EGO, '-c', TEST_CONFIGURATION]) + idc = subprocess.Popen([ + ident, '-C', TEST_REVOCATION_EGO, '-c', TEST_CONFIGURATION + ]) idc.communicate() if idc.returncode != 0: - raise Exception("gnunet-identity failed to create an ego `" + TEST_REVOCATION_EGO + "'") + raise Exception( + "gnunet-identity failed to create an ego `" + TEST_REVOCATION_EGO + + "'" + ) sys.stdout.flush() sys.stderr.flush() @@ -72,11 +80,15 @@ try: print("Testing key " + rev_key) sys.stdout.flush() sys.stderr.flush() - tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], stdout=subprocess.PIPE) + tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], + stdout=subprocess.PIPE) output_not_revoked, x = tst.communicate() output_not_revoked = output_not_revoked.decode("utf-8") if tst.returncode != 0: - raise Exception("gnunet-revocation failed to test a key - " + str(tst.returncode) + ": " + output_not_revoked) + raise Exception( + "gnunet-revocation failed to test a key - " + str(tst.returncode) + + ": " + output_not_revoked + ) if 'valid' not in output_not_revoked: res = 1 print("Key was not valid") @@ -86,7 +98,9 @@ try: print("Revoking key " + rev_key) sys.stdout.flush() sys.stderr.flush() - rev = subprocess.Popen([revoc, '-R', TEST_REVOCATION_EGO, '-p', '-c', TEST_CONFIGURATION]) + rev = subprocess.Popen([ + revoc, '-R', TEST_REVOCATION_EGO, '-p', '-c', TEST_CONFIGURATION + ]) rev.communicate() if rev.returncode != 0: raise Exception("gnunet-revocation failed to revoke a key") @@ -94,7 +108,8 @@ try: print("Testing revoked key " + rev_key) sys.stdout.flush() sys.stderr.flush() - tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], stdout=subprocess.PIPE) + tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], + stdout=subprocess.PIPE) output_revoked, x = tst.communicate() output_revoked = output_revoked.decode("utf-8") if tst.returncode != 0: |