Пример #1
0
class DataTester(unittest.TestCase):
    def setUp(self):
        self.cr = CReader('../APIInterface/sampledata')

    def tearDown(self):
        self.cr = None

    def test_10_ReadConfSecs(self):
        for s in self.cr.listSections():
            print('Sec', s)

    def test_20_ReadConfOpts(self):
        for s in self.cr.listSections():
            print('Sec', s, 'Opt', self.cr.readHDSection(s))
Пример #2
0
class DataTester(unittest.TestCase):
    
    def setUp(self):
        self.cr = CReader('../APIInterface/sampledata')
        
    def tearDown(self):
        self.cr = None
        
    def test_10_ReadConfSecs(self):
        for s in self.cr.listSections():
            print 'Sec',s
            
    def test_20_ReadConfOpts(self):
        for s in self.cr.listSections():
            print 'Sec',s,'Opt',self.cr.readHDSection(s)
Пример #3
0
class Publish(APIOperation):
    '''
    classdocs
    '''


    def __init__(self):
        self.api = SourceAPI()
        self.cr = CReader('../APIInterface/sampledata')
    
    def probe(self):
        self.api.connect()
        self.api.dispReq(self.sa.req)
        self.api.dispRes(self.sa.res)
        
    def setSRC(self):
        self.api.connect(head=self.cr.readSecOpt('fakedata1', 'header'), data=self.cr.readSecOpt('fakedata1', 'data'))
        ll = json.loads(self.api.res.read())
        print ll    
        
    def pushSRC(self):
        self.api.connect(head=self.cr.readSecOpt('fakedata2', 'header'), data=self.cr.readSecOpt('fakedata2', 'data'))
        ll = json.loads(self.api.res.read())
        print ll

    def buildContent(self):
        p = self.cr.readArcGISSection('agdata')
        c = RequestGenerator.buildContentArcGIS(p['uname'],p['sname'],p['ctype'],p['desc'],p['cats'],p['url'],p['opts'],p['scan'])
        print c
        
        q = self.cr.readArcGISSection('pgdata')
        d = RequestGenerator.buildContentArcGIS(q['uname'],q['sname'],q['ctype'],q['desc'],q['cats'],q['url'],q['opts'],q['scan'])
        print d
        
        rfc = RFC2388()
        head = rfc.headGenerator()
        data = rfc.dataGenerator((c,d))
        print head
        print data
        
        return head,data
    
    def buildContentArcGIS(self,url,opts):
        return 'url_remote={}'.format(url)
Пример #4
0
 def __init__(self):
     self.api = SourceAPI()
     self.cr = CReader('../APIInterface/sampledata')
Пример #5
0
 def setUp(self):
     self.cr = CReader('../APIInterface/sampledata')
Пример #6
0
 def setUp(self):
     self.cr = CReader('../APIInterface/sampledata')
Пример #7
0
 def __init__(self):
     '''Constructor'''
     self.cr = CReader('../APIInterface/sampledata')
     self.boundary = RFC2388.boundaryGenerator()