9
9
10
10
11
11
def _rel_path (* args ):
12
- """Forms a path relative to this file's directory."""
12
+ """Returns a path relative to config.py file's directory."""
13
13
return os .path .join (os .path .dirname (__file__ ), * args )
14
14
15
15
def get_path (directory , filename = None ):
16
+ """Returns an absolute path as seen from your current working directory.
17
+ If a file is passed as argument, returns an aboslute path including the
18
+ file."""
16
19
path = os .path .join (os .path .dirname ( __file__ ), '..' , directory )
17
20
if filename :
18
21
path = os .path .join (os .path .dirname ( __file__ ), '..' , directory , filename )
@@ -21,9 +24,9 @@ def get_path(directory, filename=None):
21
24
def jsondump (data ):
22
25
return simplejson .dumps (data , sort_keys = True , indent = 4 * ' ' )
23
26
24
- # URL of the default site to be used for testing
27
+ # URL of the default site to be used for testing.
25
28
BASE_URL = "http://localhost"
26
- # URL of the actual Codebender website
29
+ # URL of the actual Codebender website.
27
30
LIVE_SITE_URL = "https://codebender.cc"
28
31
STAGING_SITE_URL = "https://staging.codebender.cc"
29
32
@@ -41,37 +44,41 @@ def jsondump(data):
41
44
# be formatted appropriately.
42
45
LOGFILE_PREFIX = _rel_path (".." , "logs" , "%Y-%m-%d_%H-%M-%S-{log_name}.json" )
43
46
44
- # Logfile for COMPILE_TESTER compilation results
47
+ # Logfile for COMPILE_TESTER compilation results.
45
48
COMPILE_TESTER_LOGFILE = LOGFILE_PREFIX .format (log_name = "cb_compile_tester" )
46
49
COMPILE_TESTER_LOGFILE_STAGING = LOGFILE_PREFIX .format (log_name = "staging_cb_compile_tester" )
47
50
48
- # Logfile for /libraries compilation results
51
+ # Logfile for /libraries compilation results.
49
52
LIBRARIES_TEST_LOGFILE = LOGFILE_PREFIX .format (log_name = "libraries_test" )
50
53
51
- # Logfile for /libraries fetch results
54
+ # Logfile for /libraries fetch results.
52
55
LIBRARIES_FETCH_LOGFILE = LOGFILE_PREFIX .format (log_name = "libraries_fetch" )
53
56
57
+ # Directory in which Firefox and Chrome extensions are stored.
54
58
_EXTENSIONS_DIR = _rel_path ('..' , 'extensions' )
59
+
60
+ # Firefox plugin for all Firefox versions.
55
61
_FIREFOX_EXTENSION_FNAME = 'codebender.xpi'
62
+ # Chrome extension for Chrome versions < 42.
56
63
_CHROME_EXTENSION_FNAME = 'codebendercc-extension.crx'
57
64
58
65
# Maximum version number that we can use the Chrome extension with.
59
- # For versions higher than this, we need to use the newer Codebender app
66
+ # For versions higher than this, we need to use the newer Codebender app.
60
67
CHROME_EXT_MAX_CHROME_VERSION = 41
61
68
62
- # Path to YAML file specifying capability list
69
+ # Path to YAML file specifying capability list.
63
70
DEFAULT_CAPABILITIES_FILE = os .getenv ('CAPABILITIES' , 'capabilities.yaml' )
64
71
DEFAULT_CAPABILITIES_FILE_PATH = _rel_path (DEFAULT_CAPABILITIES_FILE )
65
72
66
- # Files used for testing
73
+ # Files used for testing.
67
74
TEST_DATA_DIR = _rel_path ('..' , 'test_data' )
68
75
TEST_DATA_INO = os .path .join (TEST_DATA_DIR , 'upload_ino.ino' )
69
76
TEST_DATA_ZIP = os .path .join (TEST_DATA_DIR , 'upload_zip.zip' )
70
77
71
78
# Directory in which the local compile tester files are stored.
72
79
COMPILE_TESTER_DIR = os .path .join (TEST_DATA_DIR , 'cb_compile_tester' )
73
80
74
- # Credentials to use when logging into the bachelor site
81
+ # Credentials to use when logging into the bachelor site.
75
82
TEST_CREDENTIALS = {
76
83
"username" : "tester" ,
77
84
"password" : "testerPASS"
@@ -86,7 +93,7 @@ def jsondump(data):
86
93
DEFAULT_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 codebender-selenium'
87
94
TESTS_USER_AGENT = os .getenv ('SELENIUM_USER_AGENT' , DEFAULT_USER_AGENT )
88
95
89
- # Set up Selenium Webdrivers to be used for selenium tests
96
+ # Set up Selenium Webdrivers to be used for selenium tests.
90
97
def _get_firefox_profile ():
91
98
"""Returns the Firefox profile to be used for the FF webdriver.
92
99
Specifically, we're equipping the webdriver with the Codebender
0 commit comments