Skip to content

Instantly share code, notes, and snippets.

@cdeil
Created August 7, 2013 12:56
Show Gist options
  • Select an option

  • Save cdeil/6173803 to your computer and use it in GitHub Desktop.

Select an option

Save cdeil/6173803 to your computer and use it in GitHub Desktop.
eduroam-3-163:astropy deil$ python setup.py test -P vo/samp
running test
running build
running build_py
running build_ext
skipping 'astropy/table/_np_utils.c' Cython extension (up-to-date)
skipping 'astropy/time/sofa_time.c' Cython extension (up-to-date)
skipping 'astropy/nddata/convolution/boundary_extend.c' Cython extension (up-to-date)
skipping 'astropy/nddata/convolution/boundary_fill.c' Cython extension (up-to-date)
skipping 'astropy/nddata/convolution/boundary_none.c' Cython extension (up-to-date)
skipping 'astropy/nddata/convolution/boundary_wrap.c' Cython extension (up-to-date)
regenerating default astropy.cfg file
Generation of default configuration item failed! Stdout and stderr are shown below.
Stdout:
Stderr:
/Users/deil/code/astropy/build/lib.macosx-10.8-x86_64-2.7/astropy/tests/helper.py:23: UserWarning: Module astropy was already imported from /Users/deil/code/astropy/build/lib.macosx-10.8-x86_64-2.7/astropy/__init__.pyc, but /Users/deil/Library/Python/2.7/lib/python/site-packages/astropy-0.3.dev4718-py2.7-macosx-10.8-intel.egg is being added to sys.path
import pkg_resources
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "astropy/config/configuration.py", line 646, in generate_all_config_items
for cfgitem in get_config_items(nm).itervalues():
File "astropy/config/configuration.py", line 533, in get_config_items
__import__(packageormod)
File "/Users/deil/code/astropy/build/lib.macosx-10.8-x86_64-2.7/astropy/modeling/tests/model_lists.py", line 54, in <module>
'x_lim': [-10, 10]}
NameError: name 'Sine1DModel' is not defined
running build_scripts
WARNING: Module astropy was already imported from astropy/__init__.pyc, but /Users/deil/Library/Python/2.7/lib/python/site-packages/astropy-0.3.dev4718-py2.7-macosx-10.8-intel.egg is being added to sys.path [pkg_resources]
============================================================================== test session starts ===============================================================================
platform darwin -- Python 2.7.5 -- pytest-2.3.3
Running tests with Astropy version 0.3.dev4584.
Running tests in astropy/vo/samp.
Platform: Darwin-12.4.0-x86_64-i386-64bit
Executable: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Full Python Version:
2.7.5 (default, Aug 3 2013, 17:40:43)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]
encodings: sys: ascii, locale: UTF-8, filesystem: utf-8, unicode bits: 15
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.7.1
Scipy: 0.12.0
Matplotlib: 1.2.1
h5py: 2.1.3
plugins: cov
collected 12 items
astropy/vo/samp/tests/test_core.py ...........F
==================================================================================== FAILURES ====================================================================================
______________________________________________________________________ TestSAMPCommunication.test_2_clients ______________________________________________________________________
self = <astropy.vo.samp.tests.test_core.TestSAMPCommunication object at 0x10635f890>
def test_2_clients(self):
# Create a client that uses
# the passed Hub Proxy
cli1 = samp.SAMPClient(self.myhub1, name="Client 1",
description="Test Client 1")
# Create another client
cli2 = samp.SAMPClient(self.myhub2, name="Client 2",
description="Test Client 2")
# Create metadata dictionaries
metadata1 = {"cli1.version":"0.01"}
metadata2 = {"cli2.version":"0.25"}
# Start and register clients
cli1.start()
cli1.register()
cli2.start()
cli2.register()
# Declare metadata
cli1.declareMetadata(metadata1)
cli2.declareMetadata(metadata2)
print("\nCLI1", cli1.getPrivateKey(), cli1.getPublicId(), "\n")
print("\nCLI2", cli2.getPrivateKey(), cli2.getPublicId(), "\n")
# Function called when a notification is received
def test_receive_notification(private_key, sender_id, mtype,
params, extra):
print("Notification:", private_key, sender_id, mtype, params,
extra, "\n\n")
# Function called when a call is received
def test_receive_call(private_key, sender_id, msg_id, mtype, params,
extra):
print("Call:", private_key, sender_id, msg_id, mtype, params,
extra, "\n\n")
myhub1.reply(cli1.getPrivateKey(), msg_id,
{"samp.status": SAMP_STATUS_OK,
"samp.result": {"txt": "printed"}})
# Function called when a response is received
def test_receive_response(private_key, sender_id, msg_id, response):
print("Response:", private_key, sender_id, msg_id, response, "\n\n")
# Subscribe Client 1 to "samp.*" and "samp.app.*" MType and bind it to
# the related functions
cli1.bindReceiveNotification("samp.app.*", test_receive_notification)
cli1.bindReceiveCall("samp.app.*", test_receive_call)
# Bind Client 2 message-tags received to suitable functions
cli2.bindReceiveResponse("my-dummy-print", test_receive_response)
cli2.bindReceiveResponse("my-dummy-print-specific", test_receive_response)
# Client 2 notifies to All "samp.app.echo" MType using myhub
self.myhub2.notifyAll(cli2.getPrivateKey(),
{"samp.mtype": "samp.app.echo",
"samp.params": {"txt": "Hello world!"}})
time.sleep(1)
# Client 2 calls to All "samp.app.echo" MType using "my-dummy-print"
# as message-tag
print(self.myhub2.callAll(cli2.getPrivateKey(), "my-dummy-print",
{"samp.mtype": "samp.app.echo",
> "samp.params": {"txt": "Hello world!"}}),
"\n\n")
astropy/vo/samp/tests/test_core.py:179:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astropy.vo.samp.core.SAMPHubProxy object at 0x10635f2d0>, private_key = 'k:47_aplwxeqtsqnqjdgv', msg_tag = 'my-dummy-print'
message = {'samp.mtype': 'samp.app.echo', 'samp.params': {'txt': 'Hello world!'}}
def callAll(self, private_key, msg_tag, message):
"""
Proxy to C{callAll} SAMP Hub method
"""
> return self.proxy.samp.hub.callAll(private_key, msg_tag, message)
astropy/vo/samp/core.py:3219:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[Fault("<Fault 1: 'java.lang.UnsupportedOperationException: Unknown method samp.hub.callAll.__repr__'>") raised in repr()] _ServerProxyPoolMethod object at 0x106367f80>
args = ('k:47_aplwxeqtsqnqjdgv', 'my-dummy-print', {'samp.mtype': 'samp.app.echo', 'samp.params': {'txt': 'Hello world!'}}), kwrds = {}
proxy = <ServerProxy for 127.0.0.1:2525/xmlrpc>
def __call__(self, *args, **kwrds):
proxy = self.__proxies.get()
try:
> response = eval("proxy.%s(*args, **kwrds)" % self.__name)
astropy/vo/samp/core.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
<string>:1:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[Fault("<Fault 1: 'java.lang.UnsupportedOperationException: Unknown method samp.hub.callAll.__repr__'>") raised in repr()] _Method object at 0x106367ef0>
args = ('k:47_aplwxeqtsqnqjdgv', 'my-dummy-print', {'samp.mtype': 'samp.app.echo', 'samp.params': {'txt': 'Hello world!'}})
def __call__(self, *args):
> return self.__send(self.__name, args)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py:1224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ServerProxy for 127.0.0.1:2525/xmlrpc>, methodname = 'samp.hub.callAll'
params = ('k:47_aplwxeqtsqnqjdgv', 'my-dummy-print', {'samp.mtype': 'samp.app.echo', 'samp.params': {'txt': 'Hello world!'}})
def __request(self, methodname, params):
# call a method on the remote server
request = dumps(params, methodname, encoding=self.__encoding,
allow_none=self.__allow_none)
response = self.__transport.request(
self.__host,
self.__handler,
request,
> verbose=self.__verbose
)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py:1578:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <xmlrpclib.Transport instance at 0x1063637a0>, host = '127.0.0.1:2525', handler = '/xmlrpc'
request_body = "<?xml version='1.0'?>\n<methodCall>\n<methodName>samp.hub.callAll</methodName>\n<params>\n<param>\n<value><string>k:4...me>\n<value><string>samp.app.echo</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n"
verbose = 0
def request(self, host, handler, request_body, verbose=0):
#retry request once if cached connection has gone cold
for i in (0, 1):
try:
> return self.single_request(host, handler, request_body, verbose)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py:1264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <xmlrpclib.Transport instance at 0x1063637a0>, host = '127.0.0.1:2525', handler = '/xmlrpc'
request_body = "<?xml version='1.0'?>\n<methodCall>\n<methodName>samp.hub.callAll</methodName>\n<params>\n<param>\n<value><string>k:4...me>\n<value><string>samp.app.echo</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n"
verbose = 0
def single_request(self, host, handler, request_body, verbose=0):
# issue XML-RPC request
h = self.make_connection(host)
if verbose:
h.set_debuglevel(1)
try:
self.send_request(h, handler, request_body)
self.send_host(h, host)
self.send_user_agent(h)
self.send_content(h, request_body)
response = h.getresponse(buffering=True)
if response.status == 200:
self.verbose = verbose
> return self.parse_response(response)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py:1297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <xmlrpclib.Transport instance at 0x1063637a0>, response = <httplib.HTTPResponse instance at 0x10636a518>
def parse_response(self, response):
# read response data from httpresponse, and parse it
# Check for new http response object, else it is a file object
if hasattr(response,'getheader'):
if response.getheader("Content-Encoding", "") == "gzip":
stream = GzipDecodedResponse(response)
else:
stream = response
else:
stream = response
p, u = self.getparser()
while 1:
data = stream.read(1024)
if not data:
break
if self.verbose:
print "body:", repr(data)
p.feed(data)
if stream is not response:
stream.close()
p.close()
> return u.close()
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py:1473:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <xmlrpclib.Unmarshaller instance at 0x10636a710>
def close(self):
# return response tuple and target method
if self._type is None or self._marks:
raise ResponseError()
if self._type == "fault":
> raise Fault(**self._stack[0])
E Fault: <Fault 1: 'org.astrogrid.samp.client.SampException: Connection refused'>
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py:793: Fault
-------------------------------------------------------------------------------- Captured stdout ---------------------------------------------------------------------------------
('\nCLI1', 'k:46_wqubwkljwkgjnbbb', 'c46', '\n')
('\nCLI2', 'k:47_aplwxeqtsqnqjdgv', 'c47', '\n')
('Notification:', 'k:46_wqubwkljwkgjnbbb', 'c47', 'samp.app.echo', {'txt': 'Hello world!'}, {}, '\n\n')
-------------------------------------------------------------------------------- Captured stderr ---------------------------------------------------------------------------------
[SAMP] Error (2013-08-07T14:54:30.967423): Port 21012 already in use. Impossible to run the Hub with Web Profile support.
[SAMP] Warning (2013-08-07T14:54:31.145326): Another SAMP Hub is already running. Start-up process aborted.
====================================================================== 1 failed, 11 passed in 4.16 seconds =======================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment