Created
June 25, 2019 08:34
-
-
Save pep8speaks/51a9c948ef0877dd2fbda870753a84ee to your computer and use it in GitHub Desktop.
In response to @canihavesomecoffee's comment: https://github.com/PiPot/pipot-server/pull/26#issuecomment-505345115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- original/file_to_fix.py | |
+++ fixed/file_to_fix.py | |
@@ -1,3 +1,11 @@ | |
+from mod_honeypot.models import Profile, PiModels, PiPotReport, ProfileService, \\ | |
+ CollectorTypes, Deployment | |
+from mod_config.models import Service, Notification, Actions, Conditions, Rule | |
+from mod_auth.models import User, Role, Page, PageAccess | |
+from database import create_session, Base | |
+from flask import g, current_app | |
+from collections import namedtuple | |
+import tests.config | |
import os | |
import sys | |
import mock | |
@@ -7,14 +15,6 @@ | |
# Need to append server root path to ensure we can import the necessary files. | |
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
-import tests.config | |
-from collections import namedtuple | |
-from flask import g, current_app | |
-from database import create_session, Base | |
-from mod_auth.models import User, Role, Page, PageAccess | |
-from mod_config.models import Service, Notification, Actions, Conditions, Rule | |
-from mod_honeypot.models import Profile, PiModels, PiPotReport, ProfileService, \\ | |
- CollectorTypes, Deployment | |
def generate_keys(tempdir): | |
@@ -38,20 +38,20 @@ | |
secret_csrf = secret_csrf_file.read() | |
return { | |
- 'TESTING': True, | |
- 'WTF_CSRF_ENABLED': False, | |
- 'SQLALCHEMY_POOL_SIZE': 1, | |
- 'SECRET_KEY': secret_key, | |
- 'CSRF_SESSION_KEY': secret_csrf, | |
- 'SERVER_IP': '127.0.0.1', | |
- 'SERVER_PORT': 443, | |
- 'INSTANCE_NAME': 'testInstance', | |
- 'APPLICATION_ROOT': '/', | |
- 'CSRF_ENABLED': False, | |
- 'DATABASE_URI': tests.config.DATABASE_URI, | |
- 'COLLECTOR_UDP_PORT': 1234, | |
- 'COLLECTOR_SSL_PORT': 1235 | |
- } | |
+ 'TESTING': True, | |
+ 'WTF_CSRF_ENABLED': False, | |
+ 'SQLALCHEMY_POOL_SIZE': 1, | |
+ 'SECRET_KEY': secret_key, | |
+ 'CSRF_SESSION_KEY': secret_csrf, | |
+ 'SERVER_IP': '127.0.0.1', | |
+ 'SERVER_PORT': 443, | |
+ 'INSTANCE_NAME': 'testInstance', | |
+ 'APPLICATION_ROOT': '/', | |
+ 'CSRF_ENABLED': False, | |
+ 'DATABASE_URI': tests.config.DATABASE_URI, | |
+ 'COLLECTOR_UDP_PORT': 1234, | |
+ 'COLLECTOR_SSL_PORT': 1235 | |
+ } | |
class BasicTestCase(unittest.TestCase): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment