Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
It seems like the flake8 container/rules have changed, mostly
indentation.

Ignore W605 is for invalid escape sequence '\s' in test_gpg.py:16
  • Loading branch information
emkll committed Oct 25, 2018
1 parent 5e9075c commit b4106c9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore: W605
2 changes: 1 addition & 1 deletion sd-journalist/sd-process-display
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import PyQt4.QtCore as QtCore
from PyQt4.QtGui import QDialog, QDialogButtonBox, QApplication, \
QLabel, QVBoxLayout, QImage, QPixmap
QLabel, QVBoxLayout, QImage, QPixmap
from PyQt4.QtCore import Qt
import os
import threading
Expand Down
4 changes: 2 additions & 2 deletions sd-svs/decrypt-sd-submission
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ try:
# given a malicious tarball
tar.extractall(tmpdir)

except Exception as e:
except Exception:
send_progress("DECRYPTION_BUNDLE_OPEN_FAILURE")
# although we're exiting with failure, we return a
# 0 exit code so xdg does not try to re-open this file with
Expand Down Expand Up @@ -139,7 +139,7 @@ try:
print(os.path.join(tmpdir, "extracted"))
distutils.dir_util.copy_tree(os.path.join(tmpdir, "extracted"),
"/home/user/Sources/", update=1)
except Exception as e:
except Exception:
send_progress("DECRYPTED_BUNDLE_COPY_FAILURE")
shutil.rmtree(tmpdir)
sys.exit(0)
Expand Down
30 changes: 15 additions & 15 deletions tests/integration/test_integration
Original file line number Diff line number Diff line change
Expand Up @@ -142,35 +142,35 @@ def run_q(n):

if run_q("full-success"):
receiver.expected_states = [
"DECRYPTION_PROCESS_START",
"SUBMISSION_BUNDLE_UNBUNDLED",
"SUBMISSION_FILES_EXTRACTED",
"SUBMISSION_FILE_DECRYPTION_SUCCEEDED",
"SUBMISSION_FILE_DECRYPTION_SUCCEEDED",
"DECRYPTED_BUNDLE_ON_SVS",
"DECRYPTED_FILES_AVAILABLE",
"DECRYPTION_PROCESS_START",
"SUBMISSION_BUNDLE_UNBUNDLED",
"SUBMISSION_FILES_EXTRACTED",
"SUBMISSION_FILE_DECRYPTION_SUCCEEDED",
"SUBMISSION_FILE_DECRYPTION_SUCCEEDED",
"DECRYPTED_BUNDLE_ON_SVS",
"DECRYPTED_FILES_AVAILABLE",
]
receiver.cmd = ["qvm-open-in-vm", "sd-svs", "./all.sd-xfer"]
receiver.test_name = "full successful open"
receiver.test()

if run_q("empty-download"):
receiver.expected_states = [
"DECRYPTION_PROCESS_START",
"DECRYPTION_BUNDLE_OPEN_FAILURE",
"DECRYPTION_PROCESS_START",
"DECRYPTION_BUNDLE_OPEN_FAILURE",
]
receiver.cmd = ["qvm-open-in-vm", "sd-svs", "./empty.sd-xfer"]
receiver.test_name = "empty sd-xfer"
receiver.test()

if run_q("bad-gpg-key"):
receiver.expected_states = [
"DECRYPTION_PROCESS_START",
"SUBMISSION_BUNDLE_UNBUNDLED",
"SUBMISSION_FILES_EXTRACTED",
"SUBMISSION_FILE_DECRYPTION_FAILED",
"SUBMISSION_FILE_DECRYPTION_FAILED",
"SUBMISSION_FILE_NO_FILES_FOUND",
"DECRYPTION_PROCESS_START",
"SUBMISSION_BUNDLE_UNBUNDLED",
"SUBMISSION_FILES_EXTRACTED",
"SUBMISSION_FILE_DECRYPTION_FAILED",
"SUBMISSION_FILE_DECRYPTION_FAILED",
"SUBMISSION_FILE_NO_FILES_FOUND",
]
receiver.cmd = ["qvm-open-in-vm", "sd-svs", "./bad-key.sd-xfer"]
receiver.test_name = "bad encryption key"
Expand Down
20 changes: 10 additions & 10 deletions tests/test_svs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ def setUp(self):

def test_decrypt_sd_submission(self):
self.assertFilesMatch(
"/usr/bin/decrypt-sd-submission",
"sd-svs/decrypt-sd-submission")
"/usr/bin/decrypt-sd-submission",
"sd-svs/decrypt-sd-submission")

def test_decrypt_sd_submission_desktop(self):
self.assertFilesMatch(
"/usr/share/applications/decrypt-sd-submission.desktop",
"sd-svs/decrypt-sd-submission.desktop")
"/usr/share/applications/decrypt-sd-submission.desktop",
"sd-svs/decrypt-sd-submission.desktop")

def test_decrypt_sd_user_profile(self):
self.assertFilesMatch(
"/etc/profile.d/sd-svs-qubes-gpg-domain.sh",
"sd-svs/dot-profile")
"/etc/profile.d/sd-svs-qubes-gpg-domain.sh",
"sd-svs/dot-profile")

def test_open_in_dvm_desktop(self):
self.assertFilesMatch(
"/usr/share/applications/open-in-dvm.desktop",
"sd-svs/open-in-dvm.desktop")
"/usr/share/applications/open-in-dvm.desktop",
"sd-svs/open-in-dvm.desktop")

def test_mimeapps(self):
self.assertFilesMatch(
"/usr/share/applications/mimeapps.list",
"sd-svs/mimeapps.list")
"/usr/share/applications/mimeapps.list",
"sd-svs/mimeapps.list")


def load_tests(loader, tests, pattern):
Expand Down

0 comments on commit b4106c9

Please sign in to comment.