Merge "Separate implementation of custom types and base types"

This commit is contained in:
Jenkins
2015-08-04 16:58:52 +00:00
committed by Gerrit Code Review
12 changed files with 22 additions and 14 deletions

View File

@@ -11,14 +11,16 @@
# under the License. # under the License.
import mock import mock
from translator.hot.tosca.tosca_elasticsearch import ToscaElasticsearch from translator.hot.tosca.custom_types.tosca_elasticsearch import (
ToscaElasticsearch
)
from translator.toscalib.tests.base import TestCase from translator.toscalib.tests.base import TestCase
class ToscaElasticsearchTest(TestCase): class ToscaElasticsearchTest(TestCase):
@mock.patch('translator.toscalib.nodetemplate.NodeTemplate') @mock.patch('translator.toscalib.nodetemplate.NodeTemplate')
@mock.patch('translator.hot.tosca.tosca_elasticsearch.' @mock.patch('translator.hot.tosca.custom_types.tosca_elasticsearch.'
'HotResource.__init__') 'HotResource.__init__')
def test_init(self, mock_hotres_init, mock_node): def test_init(self, mock_hotres_init, mock_node):
ToscaElasticsearch(mock_node) ToscaElasticsearch(mock_node)
@@ -28,7 +30,7 @@ class ToscaElasticsearchTest(TestCase):
'tosca.nodes.SoftwareComponent.Elasticsearch') 'tosca.nodes.SoftwareComponent.Elasticsearch')
@mock.patch('translator.toscalib.nodetemplate.NodeTemplate') @mock.patch('translator.toscalib.nodetemplate.NodeTemplate')
@mock.patch('translator.hot.tosca.tosca_elasticsearch.' @mock.patch('translator.hot.tosca.custom_types.tosca_elasticsearch.'
'HotResource.__init__') 'HotResource.__init__')
def test_handle_properties(self, mock_hotres_init, mock_node): def test_handle_properties(self, mock_hotres_init, mock_node):
p = ToscaElasticsearch(mock_node) p = ToscaElasticsearch(mock_node)

View File

@@ -11,14 +11,15 @@
# under the License. # under the License.
import mock import mock
from translator.hot.tosca.tosca_kibana import ToscaKibana from translator.hot.tosca.custom_types.tosca_kibana import ToscaKibana
from translator.toscalib.tests.base import TestCase from translator.toscalib.tests.base import TestCase
class ToscaKibanaTest(TestCase): class ToscaKibanaTest(TestCase):
@mock.patch('translator.toscalib.nodetemplate.NodeTemplate') @mock.patch('translator.toscalib.nodetemplate.NodeTemplate')
@mock.patch('translator.hot.tosca.tosca_kibana.HotResource.__init__') @mock.patch('translator.hot.tosca.custom_types.tosca_kibana.'
'HotResource.__init__')
def test_init(self, mock_hotres_init, mock_node): def test_init(self, mock_hotres_init, mock_node):
ToscaKibana(mock_node) ToscaKibana(mock_node)
# Make sure base class gets called # Make sure base class gets called
@@ -27,7 +28,8 @@ class ToscaKibanaTest(TestCase):
'tosca.nodes.SoftwareComponent.Kibana') 'tosca.nodes.SoftwareComponent.Kibana')
@mock.patch('translator.toscalib.nodetemplate.NodeTemplate') @mock.patch('translator.toscalib.nodetemplate.NodeTemplate')
@mock.patch('translator.hot.tosca.tosca_kibana.HotResource.__init__') @mock.patch('translator.hot.tosca.custom_types.tosca_kibana.'
'HotResource.__init__')
def test_handle_properties(self, mock_hotres_init, mock_node): def test_handle_properties(self, mock_hotres_init, mock_node):
p = ToscaKibana(mock_node) p = ToscaKibana(mock_node)
self.assertIsNone(p.handle_properties()) self.assertIsNone(p.handle_properties())

View File

@@ -14,25 +14,29 @@
import six import six
from translator.hot.syntax.hot_resource import HotResource from translator.hot.syntax.hot_resource import HotResource
from translator.hot.tosca.custom_types.tosca_collectd import ToscaCollectd
from translator.hot.tosca.custom_types.tosca_elasticsearch import (
ToscaElasticsearch
)
from translator.hot.tosca.custom_types.tosca_kibana import ToscaKibana
from translator.hot.tosca.custom_types.tosca_logstash import ToscaLogstash
from translator.hot.tosca.custom_types.tosca_nodejs import ToscaNodejs
from translator.hot.tosca.custom_types.tosca_paypalpizzastore import (
ToscaPaypalPizzaStore
)
from translator.hot.tosca.custom_types.tosca_rsyslog import ToscaRsyslog
from translator.hot.tosca.custom_types.tosca_wordpress import ToscaWordpress
from translator.hot.tosca.tosca_block_storage import ToscaBlockStorage from translator.hot.tosca.tosca_block_storage import ToscaBlockStorage
from translator.hot.tosca.tosca_block_storage_attachment import ( from translator.hot.tosca.tosca_block_storage_attachment import (
ToscaBlockStorageAttachment ToscaBlockStorageAttachment
) )
from translator.hot.tosca.tosca_collectd import ToscaCollectd
from translator.hot.tosca.tosca_compute import ToscaCompute from translator.hot.tosca.tosca_compute import ToscaCompute
from translator.hot.tosca.tosca_database import ToscaDatabase from translator.hot.tosca.tosca_database import ToscaDatabase
from translator.hot.tosca.tosca_dbms import ToscaDbms from translator.hot.tosca.tosca_dbms import ToscaDbms
from translator.hot.tosca.tosca_elasticsearch import ToscaElasticsearch
from translator.hot.tosca.tosca_kibana import ToscaKibana
from translator.hot.tosca.tosca_logstash import ToscaLogstash
from translator.hot.tosca.tosca_network_network import ToscaNetwork from translator.hot.tosca.tosca_network_network import ToscaNetwork
from translator.hot.tosca.tosca_network_port import ToscaNetworkPort from translator.hot.tosca.tosca_network_port import ToscaNetworkPort
from translator.hot.tosca.tosca_nodejs import ToscaNodejs
from translator.hot.tosca.tosca_object_storage import ToscaObjectStorage from translator.hot.tosca.tosca_object_storage import ToscaObjectStorage
from translator.hot.tosca.tosca_paypalpizzastore import ToscaPaypalPizzaStore
from translator.hot.tosca.tosca_rsyslog import ToscaRsyslog
from translator.hot.tosca.tosca_webserver import ToscaWebserver from translator.hot.tosca.tosca_webserver import ToscaWebserver
from translator.hot.tosca.tosca_wordpress import ToscaWordpress
from translator.toscalib.functions import GetAttribute from translator.toscalib.functions import GetAttribute
from translator.toscalib.functions import GetInput from translator.toscalib.functions import GetInput
from translator.toscalib.functions import GetProperty from translator.toscalib.functions import GetProperty