Skip to content

Commit 943b68f

Browse files
committed
Addressed comments
1 parent addefd8 commit 943b68f

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from setuptools.command import develop
2222

2323
from azure_functions_worker.version import VERSION
24-
from tests.utils.constants import AZURE_EXTENSIONS
24+
from tests.utils.constants import EXTENSIONS_CSPROJ_TEMPLATE
2525

2626
# The GitHub repository of the Azure Functions Host
2727
WEBHOST_GITHUB_API = "https://api.github.com/repos/Azure/azure-functions-host"
@@ -243,7 +243,7 @@ def _install_extensions(self):
243243

244244
if not (self.extensions_dir / "extensions.csproj").exists():
245245
with open(self.extensions_dir / "extensions.csproj", "w") as f:
246-
print(AZURE_EXTENSIONS, file=f)
246+
print(EXTENSIONS_CSPROJ_TEMPLATE, file=f)
247247

248248
with open(self.extensions_dir / "NuGet.config", "w") as f:
249249
print(NUGET_CONFIG, file=f)

tests/unittests/test_script_file_name.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setUpClass(cls):
3131

3232
@classmethod
3333
def tearDownClass(cls):
34-
# Remove the WEBSITE_HOSTNAME environment variable
34+
# Remove the PYTHON_SCRIPT_FILE_NAME environment variable
3535
os.environ.pop('PYTHON_SCRIPT_FILE_NAME')
3636
super().tearDownClass()
3737

@@ -60,7 +60,7 @@ def setUpClass(cls):
6060

6161
@classmethod
6262
def tearDownClass(cls):
63-
# Remove the WEBSITE_HOSTNAME environment variable
63+
# Remove the PYTHON_SCRIPT_FILE_NAME environment variable
6464
os.environ.pop('PYTHON_SCRIPT_FILE_NAME')
6565
super().tearDownClass()
6666

@@ -89,7 +89,7 @@ def setUpClass(cls):
8989

9090
@classmethod
9191
def tearDownClass(cls):
92-
# Remove the WEBSITE_HOSTNAME environment variable
92+
# Remove the PYTHON_SCRIPT_FILE_NAME environment variable
9393
os.environ.pop('PYTHON_SCRIPT_FILE_NAME')
9494
super().tearDownClass()
9595

tests/utils/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pathlib
44

55
# Extensions necessary for non-core bindings.
6-
AZURE_EXTENSIONS = """\
6+
EXTENSIONS_CSPROJ_TEMPLATE = """\
77
<?xml version="1.0" encoding="UTF-8"?>
88
<Project Sdk="Microsoft.NET.Sdk">
99
<PropertyGroup>

tests/utils/testutils.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
from tests.utils.constants import PYAZURE_WORKER_DIR, \
4949
PYAZURE_INTEGRATION_TEST, PROJECT_ROOT, WORKER_CONFIG, \
5050
CONSUMPTION_DOCKER_TEST, DEDICATED_DOCKER_TEST, PYAZURE_WEBHOST_DEBUG, \
51-
ARCHIVE_WEBHOST_LOGS, AZURE_EXTENSIONS
51+
ARCHIVE_WEBHOST_LOGS, EXTENSIONS_CSPROJ_TEMPLATE
5252
from tests.utils.testutils_docker import WebHostConsumption, WebHostDedicated, \
5353
DockerConfigs
5454

@@ -199,6 +199,11 @@ def get_environment_variables(cls):
199199

200200
@classmethod
201201
def docker_tests_enabled(self) -> (bool, str):
202+
"""
203+
Returns True if the environment variables
204+
CONSUMPTION_DOCKER_TEST or DEDICATED_DOCKER_TEST
205+
is enabled else returns False
206+
"""
202207
if is_envvar_true(CONSUMPTION_DOCKER_TEST):
203208
return True, CONSUMPTION_DOCKER_TEST
204209
elif is_envvar_true(DEDICATED_DOCKER_TEST):
@@ -1015,7 +1020,7 @@ def _symlink_dir(src, dst):
10151020
dst.symlink_to(src, target_is_directory=True)
10161021

10171022

1018-
def _setup_func_app(app_root, is_unit_test):
1023+
def _setup_func_app(app_root, is_unit_test=False):
10191024
extensions = app_root / 'bin'
10201025
host_json = app_root / 'host.json'
10211026
extensions_csproj_file = app_root / 'extensions.csproj'
@@ -1026,7 +1031,7 @@ def _setup_func_app(app_root, is_unit_test):
10261031

10271032
if not os.path.isfile(extensions_csproj_file) and not is_unit_test:
10281033
with open(extensions_csproj_file, 'w') as f:
1029-
f.write(AZURE_EXTENSIONS)
1034+
f.write(EXTENSIONS_CSPROJ_TEMPLATE)
10301035

10311036
_symlink_dir(EXTENSIONS_PATH, extensions)
10321037

0 commit comments

Comments
 (0)