1from unit.applications.tls import TestApplicationTLS 2from unit.status import Status 3 4 5class TestStatusTLS(TestApplicationTLS): 6 prerequisites = {'modules': {'openssl': 'any'}} 7 8 def test_status_tls_requests(self): 9 self.certificate() 10 11 assert 'success' in self.conf( 12 { 13 "listeners": { 14 "*:7080": {"pass": "routes"}, 15 "*:7081": { 16 "pass": "routes", 17 "tls": {"certificate": "default"}, 18 }, 19 }, 20 "routes": [{"action": {"return": 200}}], 21 "applications": {}, 22 } 23 ) 24 25 Status.init() 26 27 assert self.get()['status'] == 200 28 assert self.get_ssl(port=7081)['status'] == 200 29 30 assert Status.get('/requests/total') == 2 31