Esempio n. 1
0
 def setUp(self):
     if _testConf.has_option('DEFAULT', 'BaseURL'):
         self.baseURL = _testConf.get('DEFAULT', 'BaseURL')
     if _testConf.has_option('DEFAULT', 'username'):
         self.username = _testConf.get('DEFAULT', 'username')
     if _testConf.has_option('DEFAULT', 'password'):
         self.password = _testConf.get('DEFAULT', 'password')
     if _testConf.has_option('DEFAULT', 'owner'):
         self.owner = _testConf.get('DEFAULT', 'owner')
     pass
 def test_dbl_read(self):
     '''
     Tests accessibility of cfg file, does not check format
     '''
     CFPropertyManager.SERVICE_URL=_testConf.get('DEFAULT', 'BaseURL')
     CFPropertyManager.username=_testConf.get('DEFAULT', 'username')
     CFPropertyManager.password=_testConf.get('DEFAULT', 'password')
     CFPropertyManager.startClient()
     fo = open("cf-property-manager-test-dbl", "w+")
     fo.write("UT:RF-Cu:1{LD}Time:ShtDwn-I")
     fo.close()
     dbllines = CFPropertyManager.readDBL("cf-property-manager-test-dbl")
     for line in dbllines:
         self.assertTrue(line in CFPropertyManager.dbllines)
     return dbllines
 def test_dbl_read(self):
     '''
     Tests accessibility of cfg file, does not check format
     '''
     CFPropertyManager.SERVICE_URL = _testConf.get('DEFAULT', 'BaseURL')
     CFPropertyManager.username = _testConf.get('DEFAULT', 'username')
     CFPropertyManager.password = _testConf.get('DEFAULT', 'password')
     CFPropertyManager.startClient()
     fo = open("cf-property-manager-test-dbl", "w+")
     fo.write("UT:RF-Cu:1{LD}Time:ShtDwn-I")
     fo.close()
     dbllines = CFPropertyManager.readDBL("cf-property-manager-test-dbl")
     for line in dbllines:
         self.assertTrue(line in CFPropertyManager.dbllines)
     return dbllines
 def test_cfg_read(self):
     '''
     Tests accessibility of cfg file, does not check format
     '''
     global cfglines
     CFPropertyManager.SERVICE_URL=_testConf.get('DEFAULT', 'BaseURL')
     CFPropertyManager.username=_testConf.get('DEFAULT', 'username')
     CFPropertyManager.password=_testConf.get('DEFAULT', 'password')
     CFPropertyManager.startClient()
     fo = open("cf-property-manager-test-cfg", "w+")
     fo.write("devName=[{][^:}][^:}]*\ndevType=[:][^{]*?[:}](?!.*[{])\nIGNORE=.*WtrSkid.*")
     fo.close()
     cfglines = CFPropertyManager.readConfiguration("cf-property-manager-test-cfg")
     for line in cfglines:
         self.assertTrue(line in CFPropertyManager.cfglines)
     return cfglines
 def test_cfg_read(self):
     '''
     Tests accessibility of cfg file, does not check format
     '''
     global cfglines
     CFPropertyManager.SERVICE_URL = _testConf.get('DEFAULT', 'BaseURL')
     CFPropertyManager.username = _testConf.get('DEFAULT', 'username')
     CFPropertyManager.password = _testConf.get('DEFAULT', 'password')
     CFPropertyManager.startClient()
     fo = open("cf-property-manager-test-cfg", "w+")
     fo.write(
         "devName=[{][^:}][^:}]*\ndevType=[:][^{]*?[:}](?!.*[{])\nIGNORE=.*WtrSkid.*"
     )
     fo.close()
     cfglines = CFPropertyManager.readConfiguration(
         "cf-property-manager-test-cfg")
     for line in cfglines:
         self.assertTrue(line in CFPropertyManager.cfglines)
     return cfglines
Esempio n. 6
0
import unittest
try:
    from json import JSONDecoder, JSONEncoder
except ImportError:
    from simplejson import JSONDecoder, JSONEncoder
from restful_lib import Connection
from copy import copy
import sys, os

from _testConf import _testConf

base_url = os.getenv("BASEURL")
if base_url is None:
    base_url = _testConf.get('DEFAULT', 'BaseURL')

secure_url = os.getenv("SECUREURL")
if secure_url is None:
    secure_url = _testConf.get('DEFAULT', 'SecureURL')

user_tag = _testConf.get('DEFAULT', 'tagUsername')
user_prop = _testConf.get('DEFAULT', 'propUsername')
user_prop2 = _testConf.get('DEFAULT', 'propUsername2')
user_chan = _testConf.get('DEFAULT', 'channelUsername')
user_chan2 = _testConf.get('DEFAULT', 'channelUsername2')
user_admin = _testConf.get('DEFAULT', 'username')

conn_none = Connection(base_url)
conn_none_secure = Connection(secure_url)
conn_tag   = Connection(secure_url, username=user_tag,   \
                        password=_testConf.get('DEFAULT', 'tagPassword'))
conn_tag_plain = Connection(base_url, username=user_tag,   \
import unittest
try: from json import JSONDecoder, JSONEncoder
except ImportError: from simplejson import JSONDecoder, JSONEncoder
from restful_lib import Connection
from copy import copy
import sys, os

from _testConf import _testConf

base_url = os.getenv("BASEURL")
if base_url is None:
    base_url = _testConf.get('DEFAULT', 'BaseURL')

secure_url = os.getenv("SECUREURL")
if secure_url is None:
    secure_url = _testConf.get('DEFAULT', 'SecureURL')

user_tag = _testConf.get('DEFAULT', 'tagUsername')
user_prop = _testConf.get('DEFAULT', 'propUsername')
user_prop2 =_testConf.get('DEFAULT', 'propUsername2')
user_chan = _testConf.get('DEFAULT', 'channelUsername')
user_chan2 =_testConf.get('DEFAULT', 'channelUsername2')
user_admin = _testConf.get('DEFAULT', 'username')

conn_none  = Connection(base_url)
conn_none_secure = Connection(secure_url)
conn_tag   = Connection(secure_url, username=user_tag,   \
                        password=_testConf.get('DEFAULT', 'tagPassword'))
conn_tag_plain = Connection(base_url, username=user_tag,   \
                        password=_testConf.get('DEFAULT', 'tagPassword'))
conn_prop  = Connection(secure_url, username=user_prop,  \
import unittest
from time import sleep

try:
    from json import JSONDecoder, JSONEncoder
except ImportError:
    from simplejson import JSONDecoder, JSONEncoder
from restful_lib import Connection
from copy import copy
import sys, os

from _testConf import _testConf

base_url = os.getenv("BASEURL")
if base_url is None:
    base_url = _testConf.get("DEFAULT", "BaseURL")

secure_url = os.getenv("SECUREURL")
if secure_url is None:
    secure_url = _testConf.get("DEFAULT", "SecureURL")

user_tag = _testConf.get("DEFAULT", "tagUsername")
user_prop = _testConf.get("DEFAULT", "propUsername")
user_prop2 = _testConf.get("DEFAULT", "propUsername2")
user_chan = _testConf.get("DEFAULT", "channelUsername")
user_chan2 = _testConf.get("DEFAULT", "channelUsername2")
user_admin = _testConf.get("DEFAULT", "username")

conn_none = Connection(base_url)
conn_none_secure = Connection(secure_url)
conn_tag = Connection(secure_url, username=user_tag, password=_testConf.get("DEFAULT", "tagPassword"))