summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2024-01-27 18:23:23 -0700
committerGitHub <noreply@github.com>2024-01-27 18:23:23 -0700
commit55f9eb0bb0b72fe60ecde7529edbc27aceade187 (patch)
tree1e34614ff9be1c59ad6a2ebb1f4e8bc2a17c6c1d /tests
parent19ae96b97ea055c2e36c8fb86819c426b37ab6af (diff)
parentfd42b0c8d08f69f88e3728b1c1ff3f50071f4b30 (diff)
downloadpyramid-55f9eb0bb0b72fe60ecde7529edbc27aceade187.tar.gz
pyramid-55f9eb0bb0b72fe60ecde7529edbc27aceade187.tar.bz2
pyramid-55f9eb0bb0b72fe60ecde7529edbc27aceade187.zip
Merge pull request #3735 from adroullier/script_info
Adding script name to 'global_config' during application setup
Diffstat (limited to 'tests')
-rw-r--r--tests/test_paster.py1
-rw-r--r--tests/test_scripts/test_prequest.py9
-rw-r--r--tests/test_scripts/test_pserve.py4
3 files changed, 12 insertions, 2 deletions
diff --git a/tests/test_paster.py b/tests/test_paster.py
index 09e3bb868..e787e6973 100644
--- a/tests/test_paster.py
+++ b/tests/test_paster.py
@@ -159,6 +159,7 @@ class Test_bootstrap(unittest.TestCase):
result = self._callFUT('/foo/bar/myapp.ini', request)
self.assertEqual(result['app'], self.app)
self.assertEqual(result['root'], self.root)
+ self.assertEqual(self.get_app.kw['options']['__script__'], 'bootstrap')
self.assertTrue('closer' in result)
diff --git a/tests/test_scripts/test_prequest.py b/tests/test_scripts/test_prequest.py
index 2214f6350..4ff6cb34c 100644
--- a/tests/test_scripts/test_prequest.py
+++ b/tests/test_scripts/test_prequest.py
@@ -234,10 +234,17 @@ class TestPRequestCommand(unittest.TestCase):
self.assertEqual(self._out, [b'abc'])
def test_command_method_configures_logging(self):
- command = self._makeOne(['', 'development.ini', '/'])
+ command = self._makeOne(['', '--method=GET', 'development.ini', '/'])
command.run()
self.assertEqual(self.loader.calls[0]['op'], 'logging')
+ def test_command_script_name(self):
+ command = self._makeOne(['', '--method=GET', 'development.ini', '/'])
+ command.run()
+ self.assertEqual(
+ self.loader.calls[0]['defaults']['__script__'], 'prequest'
+ )
+
class Test_main(unittest.TestCase):
def _callFUT(self, argv):
diff --git a/tests/test_scripts/test_pserve.py b/tests/test_scripts/test_pserve.py
index 5e5c28c7b..a56f25597 100644
--- a/tests/test_scripts/test_pserve.py
+++ b/tests/test_scripts/test_pserve.py
@@ -47,7 +47,9 @@ class TestPServeCommand(unittest.TestCase):
self.loader.server = lambda x: x
inst.run()
- self.assertEqual(app.global_conf, {'a': '1', 'b': '2'})
+ self.assertEqual(
+ app.global_conf, {'a': '1', 'b': '2', '__script__': 'pserve'}
+ )
def test_original_ignore_files(self):
msg = 'A change to "ignore_files" was detected'