Tests: more configuration tests.

This commit is contained in:
Andrey Zelenkov
2018-02-26 20:18:24 +03:00
parent a89747e97c
commit 6aa00fa8d0
3 changed files with 29 additions and 11 deletions

View File

@@ -21,6 +21,15 @@ class TestUnitConfiguration(unit.TestUnitControl):
}
""", '/applications'), 'unicode')
self.assertDictEqual(self.conf_get('/applications'), {
"app": {
"type": "python",
"processes": { "spare": 0 },
"path": "/app",
"module": "wsgi"
}
}, 'unicode get')
def test_json_unicode_2(self):
self.assertIn('success', self.conf({
"приложение": {
@@ -31,6 +40,9 @@ class TestUnitConfiguration(unit.TestUnitControl):
}
}, '/applications'), 'unicode 2')
self.assertIn('приложение', self.conf_get('/applications'),
'unicode 2 get')
def test_json_unicode_number(self):
self.assertIn('error', self.conf(b"""
{
@@ -49,16 +61,6 @@ class TestUnitConfiguration(unit.TestUnitControl):
def test_applications_string(self):
self.assertIn('error', self.conf('"{}"', '/applications'), 'string')
def test_negative_spare(self):
self.assertIn('error', self.conf({
"app": {
"type": "python",
"processes": { "spare": -1 },
"path": "/app",
"module": "wsgi"
}
}, '/applications'), 'negative spare')
def test_applications_type_only(self):
self.assertIn('error', self.conf({
"app": {