Refactor PHP tests dropping legacy controller (backend)
This commit is contained in:
parent
58395147c9
commit
14fbd98e33
|
@ -63,9 +63,9 @@ class StaticWebAppMixin(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PHPFcidWebAppMixin(StaticWebAppMixin):
|
class PHPFPMWebAppMixin(StaticWebAppMixin):
|
||||||
backend = backends.phpfcgid.PHPFcgidBackend
|
backend = backends.php.PHPController
|
||||||
type_value = 'php5.2'
|
type_value = 'php5.5'
|
||||||
token = random_ascii(100)
|
token = random_ascii(100)
|
||||||
page = (
|
page = (
|
||||||
'index.php',
|
'index.php',
|
||||||
|
@ -74,11 +74,6 @@ class PHPFcidWebAppMixin(StaticWebAppMixin):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PHPFPMWebAppMixin(PHPFcidWebAppMixin):
|
|
||||||
backend = backends.phpfpm.PHPFPMBackend
|
|
||||||
type_value = 'php5.5'
|
|
||||||
|
|
||||||
|
|
||||||
class RESTWebAppMixin(object):
|
class RESTWebAppMixin(object):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(RESTWebAppMixin, self).setUp()
|
super(RESTWebAppMixin, self).setUp()
|
||||||
|
@ -120,10 +115,6 @@ class StaticRESTWebAppTest(StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, Base
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PHPFcidRESTWebAppTest(PHPFcidWebAppMixin, RESTWebAppMixin, WebAppMixin, BaseLiveServerTestCase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class PHPFPMRESTWebAppTest(PHPFPMWebAppMixin, RESTWebAppMixin, WebAppMixin, BaseLiveServerTestCase):
|
class PHPFPMRESTWebAppTest(PHPFPMWebAppMixin, RESTWebAppMixin, WebAppMixin, BaseLiveServerTestCase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import requests
|
||||||
from orchestra.contrib.domains.models import Domain, Record
|
from orchestra.contrib.domains.models import Domain, Record
|
||||||
from orchestra.contrib.domains.backends import Bind9MasterDomainController
|
from orchestra.contrib.domains.backends import Bind9MasterDomainController
|
||||||
from orchestra.contrib.orchestration.models import Server, Route
|
from orchestra.contrib.orchestration.models import Server, Route
|
||||||
from orchestra.contrib.webapps.tests.functional_tests.tests import StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, PHPFcidWebAppMixin, PHPFPMWebAppMixin
|
from orchestra.contrib.webapps.tests.functional_tests.tests import StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, PHPFPMWebAppMixin
|
||||||
from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, save_response_on_error
|
from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, save_response_on_error
|
||||||
|
|
||||||
from ... import backends
|
from ... import backends
|
||||||
|
@ -102,9 +102,9 @@ class StaticRESTWebsiteTest(RESTWebsiteMixin, StaticWebAppMixin, WebsiteMixin, B
|
||||||
self.addCleanup(self.delete_website, website)
|
self.addCleanup(self.delete_website, website)
|
||||||
self.validate_add_website(website, domain)
|
self.validate_add_website(website, domain)
|
||||||
|
|
||||||
self.type_value = PHPFcidWebAppMixin.type_value
|
self.type_value = PHPFPMWebAppMixin.type_value
|
||||||
self.backend = PHPFcidWebAppMixin.backend
|
self.backend = PHPFPMWebAppMixin.backend
|
||||||
self.page = PHPFcidWebAppMixin.page
|
self.page = PHPFPMWebAppMixin.page
|
||||||
self.add_route()
|
self.add_route()
|
||||||
webapp = '%s_%s_webapp' % (random_ascii(10), self.type_value)
|
webapp = '%s_%s_webapp' % (random_ascii(10), self.type_value)
|
||||||
self.add_webapp(webapp)
|
self.add_webapp(webapp)
|
||||||
|
@ -130,10 +130,6 @@ class StaticRESTWebsiteTest(RESTWebsiteMixin, StaticWebAppMixin, WebsiteMixin, B
|
||||||
self.assertEqual(self.page[2], requests.get(url).content)
|
self.assertEqual(self.page[2], requests.get(url).content)
|
||||||
|
|
||||||
|
|
||||||
class PHPFcidRESTWebsiteTest(RESTWebsiteMixin, PHPFcidWebAppMixin, WebsiteMixin, BaseLiveServerTestCase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class PHPFPMRESTWebsiteTest(RESTWebsiteMixin, PHPFPMWebAppMixin, WebsiteMixin, BaseLiveServerTestCase):
|
class PHPFPMRESTWebsiteTest(RESTWebsiteMixin, PHPFPMWebAppMixin, WebsiteMixin, BaseLiveServerTestCase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue