summaryrefslogtreecommitdiffhomepage
path: root/test/test_php_basic.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-04-14 02:35:04 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-04-14 02:35:04 +0100
commit0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc (patch)
tree99dd1db9a07c82aafd61b3afb03d12e65e0d399d /test/test_php_basic.py
parent58cc13ab291cac5b13462006e3feb780178ef5f3 (diff)
downloadunit-0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc.tar.gz
unit-0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc.tar.bz2
Tests: minor fixes and style.
Diffstat (limited to 'test/test_php_basic.py')
-rw-r--r--test/test_php_basic.py56
1 files changed, 8 insertions, 48 deletions
diff --git a/test/test_php_basic.py b/test/test_php_basic.py
index 7ecff1b2..5fde3e00 100644
--- a/test/test_php_basic.py
+++ b/test/test_php_basic.py
@@ -37,9 +37,6 @@ class TestPHPBasic(TestControl):
'applications',
)
- def test_php_get_applications_prefix(self):
- self.conf(self.conf_app, 'applications')
-
self.assertEqual(
self.conf_get('applications'),
{
@@ -53,9 +50,6 @@ class TestPHPBasic(TestControl):
'applications prefix',
)
- def test_php_get_applications_prefix_2(self):
- self.conf(self.conf_app, 'applications')
-
self.assertEqual(
self.conf_get('applications/app'),
{
@@ -67,9 +61,6 @@ class TestPHPBasic(TestControl):
'applications prefix 2',
)
- def test_php_get_applications_prefix_3(self):
- self.conf(self.conf_app, 'applications')
-
self.assertEqual(self.conf_get('applications/app/type'), 'php', 'type')
self.assertEqual(
self.conf_get('applications/app/processes/spare'),
@@ -86,18 +77,12 @@ class TestPHPBasic(TestControl):
'listeners',
)
- def test_php_get_listeners_prefix(self):
- self.conf(self.conf_basic)
-
self.assertEqual(
self.conf_get('listeners'),
{"*:7080": {"pass": "applications/app"}},
'listeners prefix',
)
- def test_php_get_listeners_prefix_2(self):
- self.conf(self.conf_basic)
-
self.assertEqual(
self.conf_get('listeners/*:7080'),
{"pass": "applications/app"},
@@ -147,49 +132,24 @@ class TestPHPBasic(TestControl):
def test_php_delete(self):
self.conf(self.conf_basic)
- self.assertIn(
- 'error',
- self.conf_delete('applications/app'),
- 'delete app before listener',
- )
- self.assertIn(
- 'success', self.conf_delete('listeners/*:7080'), 'delete listener'
- )
- self.assertIn(
- 'success',
- self.conf_delete('applications/app'),
- 'delete app after listener',
- )
- self.assertIn(
- 'error', self.conf_delete('applications/app'), 'delete app again'
- )
+ self.assertIn('error', self.conf_delete('applications/app'))
+ self.assertIn('success', self.conf_delete('listeners/*:7080'))
+ self.assertIn('success', self.conf_delete('applications/app'))
+ self.assertIn('error', self.conf_delete('applications/app'))
def test_php_delete_blocks(self):
self.conf(self.conf_basic)
- self.assertIn(
- 'success',
- self.conf_delete('listeners'),
- 'listeners delete',
- )
-
- self.assertIn(
- 'success',
- self.conf_delete('applications'),
- 'applications delete',
- )
-
- self.assertIn(
- 'success',
- self.conf(self.conf_app, 'applications'),
- 'listeners restore',
- )
+ self.assertIn('success', self.conf_delete('listeners'))
+ self.assertIn('success', self.conf_delete('applications'))
+ self.assertIn('success', self.conf(self.conf_app, 'applications'))
self.assertIn(
'success',
self.conf({"*:7081": {"pass": "applications/app"}}, 'listeners'),
'applications restore',
)
+
if __name__ == '__main__':
TestPHPBasic.main()