Skip to content

Commit

Permalink
fixes to broken int tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ianfixes committed Oct 18, 2012
1 parent 6f64c62 commit 09f6f52
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from interface.services.icontainer_agent import ContainerAgentClient

#from pyon.ion.endpoint import ProcessRPCClient
from ion.services.sa.resource_impl.resource_impl import ResourceImpl
from pyon.public import Container, log, IonObject
from pyon.util.containers import DotDict
from pyon.util.int_test import IonIntegrationTestCase

from interface.services.coi.iresource_registry_service import ResourceRegistryServiceClient
Expand Down Expand Up @@ -168,7 +170,14 @@ def addInstOwner(inst_id, subject):


# cleanup
#self.IMS.force_delete_instrument_agent(instrument_agent_id)
c = DotDict()
c.resource_registry = self.RR
resource_impl = ResourceImpl(c)
resource_impl.pluck(instrument_agent_id)
resource_impl.pluck(instrument_model_id)
resource_impl.pluck(instrument_device_id)
resource_impl.pluck(platform_agent_id)
self.IMS.force_delete_instrument_agent(instrument_agent_id)
self.IMS.force_delete_instrument_model(instrument_model_id)
self.IMS.force_delete_instrument_device(instrument_device_id)
self.IMS.force_delete_platform_agent_instance(platform_agent_instance_id)
Expand Down
9 changes: 8 additions & 1 deletion ion/services/sa/observatory/test/test_deployment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#from interface.services.icontainer_agent import ContainerAgentClient
#from pyon.ion.endpoint import ProcessRPCClient
from ion.services.sa.resource_impl.resource_impl import ResourceImpl
from pyon.public import Container, log, IonObject
from pyon.util.containers import DotDict
from pyon.util.int_test import IonIntegrationTestCase
Expand Down Expand Up @@ -53,6 +54,11 @@ def setUp(self):
self.damsclient = DataAcquisitionManagementServiceClient(node=self.container.node)
self.psmsclient = PubsubManagementServiceClient(node=self.container.node)

self.c = DotDict()
self.c.resource_registry = self.rrclient
self.resource_impl = ResourceImpl(self.c)


#@unittest.skip("targeting")
def test_create_deployment(self):

Expand Down Expand Up @@ -91,7 +97,8 @@ def test_create_deployment(self):
self.assertEqual(len(device_ids), 1)

#delete the deployment
self.omsclient.delete_deployment(deployment_id)
self.resource_impl.pluck(deployment_id)
self.omsclient.force_delete_deployment(deployment_id)
# now try to get the deleted dp object
try:
deployment_obj = self.omsclient.read_deployment(deployment_id)
Expand Down
4 changes: 4 additions & 0 deletions ion/services/sa/test/test_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ def template_tst_deployment_context(self, context=None):
c2 = DotDict()
c2.resource_registry = self.client.RR
instrument_site_impl = InstrumentSiteImpl(c2)
resource_impl = ResourceImpl(c2)

log.info("Create a instrument model")
instrument_model_id = self.generic_fcruf_script(RT.InstrumentModel,
Expand Down Expand Up @@ -767,6 +768,9 @@ def template_tst_deployment_context(self, context=None):
c.OMS.activate_deployment(deployment_id, True)

# cleanup
resource_impl.pluck(instrument_model_id)
resource_impl.pluck(deployment_id)
resource_impl.pluck(instrument_device_id)
c.IMS.force_delete_instrument_model(instrument_model_id)
c.IMS.force_delete_instrument_device(instrument_device_id)
c.OMS.force_delete_instrument_site(instrument_site_id)
Expand Down

0 comments on commit 09f6f52

Please sign in to comment.