def test_setcapabilities(self): server = 'http://demo.opencastproject.org:8080' user = '******' password = '******' client_name = 'rubenrua_pr' client_address = '172.20.209.225' client = OCHTTPClient(server, user, password) client.hostname = client_name client.address = client_address out = parseString(client.setconfiguration({})) for item in out.getElementsByTagName('item'): if item.getAttribute('key') == 'service.pid': self.assertEqual(item.firstChild.firstChild.wholeText, 'galicaster')
def test_setstate(self): server = 'http://demo.opencastproject.org:8080' user = '******' password = '******' client_name = 'rubenrua_pr' client_address = '172.20.209.225' client_states = [ 'shutting_down', 'capturing', 'uploading', 'unknown', 'idle' ] client = OCHTTPClient(server, user, password) client.hostname = client_name client.address = client_address for state in client_states: a = client.setstate(state) self.assertEqual(a, '{0} set to {1}'.format(client_name, state))