Ejemplo n.º 1
0
class LayEdTestCase(unittest.TestCase):
    """Test of the auth module"""

    le = None # LayEd
    dbm = None # DbMan
    config = None

    def setUp(self):
        cfg = ConfigParser.SafeConfigParser()
        cfg.read((os.path.join(TEST_DIR,"tests.cfg")))
        cfg.set("FileMan","testdir",TEST_DIR)
        self.le = LayEd(cfg)
        self.dbm = DbMan(cfg)
        self.config = cfg

    def test_getData(self):
        
        roles = [ 
                    { 
                      "roleName": "hasici",
                      "roleTitle": "FireMen"
                    },
                    {
                     "roleName": "aagroup",
                     "roleTitle": "AA Group"
                    }
                ]  

        print "*** roles ***"
        print roles

        print "***  getData() ... ***"
        head, cont = self.le.getData(roles, userName='******')
        print "headers"
        print head
        print "response"
        print cont

        #head, cont = self.le.getDataDirect(roles)
        #print "***  getDataDirect() ***"
        #print "headers"
        #print head
        #print "response"
        #print cont

        print "*** syncing ... ***"
        head, cont = self.le.syncDataPad(roles)
        print "headers"
        print head
        print "response"
        print cont

        print "***  getData() ... ***"
        head, cont = self.le.getData(roles, userName='******')
        print "headers"
        print head
        print "response"
        print cont
Ejemplo n.º 2
0
class LayEdTestCase(unittest.TestCase):
    """Test of the auth module"""

    le = None  # LayEd
    dbm = None  # DbMan
    config = None

    def setUp(self):
        cfg = ConfigParser.SafeConfigParser()
        cfg.read((os.path.join(TEST_DIR, "tests.cfg")))
        cfg.set("FileMan", "testdir", TEST_DIR)
        self.le = LayEd(cfg)
        self.dbm = DbMan(cfg)
        self.config = cfg

    def test_getData(self):

        roles = [{
            "roleName": "hasici",
            "roleTitle": "FireMen"
        }, {
            "roleName": "aagroup",
            "roleTitle": "AA Group"
        }]

        print "*** roles ***"
        print roles

        print "***  getData() ... ***"
        head, cont = self.le.getData(roles, userName='******')
        print "headers"
        print head
        print "response"
        print cont

        #head, cont = self.le.getDataDirect(roles)
        #print "***  getDataDirect() ***"
        #print "headers"
        #print head
        #print "response"
        #print cont

        print "*** syncing ... ***"
        head, cont = self.le.syncDataPad(roles)
        print "headers"
        print head
        print "response"
        print cont

        print "***  getData() ... ***"
        head, cont = self.le.getData(roles, userName='******')
        print "headers"
        print head
        print "response"
        print cont