Skip to content

Commit 9e57547

Browse files
author
Konstantinacc
committed
Added comments to config.py file.
1 parent 07440b1 commit 9e57547

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

codebender_testing/config.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99

1010

1111
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."""
1313
return os.path.join(os.path.dirname(__file__), *args)
1414

1515
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."""
1619
path = os.path.join(os.path.dirname( __file__ ), '..', directory)
1720
if filename:
1821
path = os.path.join(os.path.dirname( __file__ ), '..', directory, filename)
@@ -21,9 +24,9 @@ def get_path(directory, filename=None):
2124
def jsondump(data):
2225
return simplejson.dumps(data, sort_keys=True, indent=4 * ' ')
2326

24-
# URL of the default site to be used for testing
27+
# URL of the default site to be used for testing.
2528
BASE_URL = "http://localhost"
26-
# URL of the actual Codebender website
29+
# URL of the actual Codebender website.
2730
LIVE_SITE_URL = "https://codebender.cc"
2831
STAGING_SITE_URL = "https://staging.codebender.cc"
2932

@@ -41,37 +44,41 @@ def jsondump(data):
4144
# be formatted appropriately.
4245
LOGFILE_PREFIX = _rel_path("..", "logs", "%Y-%m-%d_%H-%M-%S-{log_name}.json")
4346

44-
# Logfile for COMPILE_TESTER compilation results
47+
# Logfile for COMPILE_TESTER compilation results.
4548
COMPILE_TESTER_LOGFILE = LOGFILE_PREFIX.format(log_name="cb_compile_tester")
4649
COMPILE_TESTER_LOGFILE_STAGING = LOGFILE_PREFIX.format(log_name="staging_cb_compile_tester")
4750

48-
# Logfile for /libraries compilation results
51+
# Logfile for /libraries compilation results.
4952
LIBRARIES_TEST_LOGFILE = LOGFILE_PREFIX.format(log_name="libraries_test")
5053

51-
# Logfile for /libraries fetch results
54+
# Logfile for /libraries fetch results.
5255
LIBRARIES_FETCH_LOGFILE = LOGFILE_PREFIX.format(log_name="libraries_fetch")
5356

57+
# Directory in which Firefox and Chrome extensions are stored.
5458
_EXTENSIONS_DIR = _rel_path('..', 'extensions')
59+
60+
# Firefox plugin for all Firefox versions.
5561
_FIREFOX_EXTENSION_FNAME = 'codebender.xpi'
62+
# Chrome extension for Chrome versions < 42.
5663
_CHROME_EXTENSION_FNAME = 'codebendercc-extension.crx'
5764

5865
# 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.
6067
CHROME_EXT_MAX_CHROME_VERSION = 41
6168

62-
# Path to YAML file specifying capability list
69+
# Path to YAML file specifying capability list.
6370
DEFAULT_CAPABILITIES_FILE = os.getenv('CAPABILITIES', 'capabilities.yaml')
6471
DEFAULT_CAPABILITIES_FILE_PATH = _rel_path(DEFAULT_CAPABILITIES_FILE)
6572

66-
# Files used for testing
73+
# Files used for testing.
6774
TEST_DATA_DIR = _rel_path('..', 'test_data')
6875
TEST_DATA_INO = os.path.join(TEST_DATA_DIR, 'upload_ino.ino')
6976
TEST_DATA_ZIP = os.path.join(TEST_DATA_DIR, 'upload_zip.zip')
7077

7178
# Directory in which the local compile tester files are stored.
7279
COMPILE_TESTER_DIR = os.path.join(TEST_DATA_DIR, 'cb_compile_tester')
7380

74-
# Credentials to use when logging into the bachelor site
81+
# Credentials to use when logging into the bachelor site.
7582
TEST_CREDENTIALS = {
7683
"username": "tester",
7784
"password": "testerPASS"
@@ -86,7 +93,7 @@ def jsondump(data):
8693
DEFAULT_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 codebender-selenium'
8794
TESTS_USER_AGENT = os.getenv('SELENIUM_USER_AGENT', DEFAULT_USER_AGENT)
8895

89-
# Set up Selenium Webdrivers to be used for selenium tests
96+
# Set up Selenium Webdrivers to be used for selenium tests.
9097
def _get_firefox_profile():
9198
"""Returns the Firefox profile to be used for the FF webdriver.
9299
Specifically, we're equipping the webdriver with the Codebender

0 commit comments

Comments
 (0)