Tests: minor fixes and style.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user