Esempio n. 1
0
 def testIncludeByName(self):
     conf = {"libraries": {"include": {"fooLib": {}}}}
     lv = LibraryValidator(conf)
     self.failUnless(
         lv.isValid("fooLib", "someType", "someVersion",
                    ["qxVer1", "qxVer2"]))
     self.failIf(
         lv.isValid("barLib", "someType", "someVersion",
                    ["qxVer1", "qxVer2"]))
Esempio n. 2
0
 def testIncludeAll(self):
     conf = { 
       "libraries" : {
         "include" : {
           "*" : {}
         }
       } 
     }
     lv = LibraryValidator(conf)
     self.failUnless(lv.isValid("someLib", "someType", "someVersion", ["qxVer1", "qxVer2"]))
Esempio n. 3
0
 def testIncludeByName(self):
     conf = { 
       "libraries" : {
         "include" : {
           "fooLib" : {}
         }
       } 
     }
     lv = LibraryValidator(conf)
     self.failUnless(lv.isValid("fooLib", "someType", "someVersion", ["qxVer1", "qxVer2"]))
     self.failIf(lv.isValid("barLib", "someType", "someVersion", ["qxVer1", "qxVer2"]))
Esempio n. 4
0
 def testIncludeWildcardLib(self):
     conf = {
       "libraries" :
       {
         "include" : {
           "*" : {
             "types" : ["contribution", "widget"],
             "versions" : ["trunk", "1.0"],
             "qooxdoo-versions" : ["1.0.1", "1.1"]
           }
         }
       }
     }
     lv = LibraryValidator(conf)
     self.failUnless(lv.isValid("fooLib", "widget", "1.0", ["trunk", "1.1"]), "Valid library deemed invalid!")
Esempio n. 5
0
    def testIncludeExplicit(self):
        conf = {
            "libraries": {
                "include": {
                    "fooLib": {
                        "types": ["contribution", "widget"],
                        "versions": ["trunk", "1.0"],
                        "qooxdoo-versions": ["1.0.1", "1.1"]
                    }
                }
            }
        }
        lv = LibraryValidator(conf)

        self.failUnless(
            lv.isValid("fooLib", "widget", "1.0", ["trunk", "1.1"]),
            "Valid library deemed invalid!")
        self.failIf(
            lv.isValid("barLib", "someType", "someVersion",
                       ["qxVer1", "qxVer2"]),
            "Library with excluded name validated!")
        self.failIf(lv.isValid("fooLib", "backend", "1.0", ["trunk", "1.1"]),
                    "Library with excluded type validated!")
        self.failIf(
            lv.isValid("fooLib", "contribution", "0.1", ["trunk", "1.1"]),
            "Library with excluded version validated!")
        self.failIf(lv.isValid("fooLib", "contribution", "1.0", ["trunk"]),
                    "Library with excluded qooxdoo version validated!")
Esempio n. 6
0
 def testExcludeLibrary(self):
     conf = {
       "libraries" :
       {
         "include" : {
           "*" : {}
         },
         "exclude" : {
           "fooLib" : {
             "types" : ["*"],
             "versions" : ["*"],
             "qooxdoo-versions" : ["*"]
           }
         }
       }
     }
     lv = LibraryValidator(conf)
     self.failIf(lv.isValid("fooLib", "widget", "1.0", ["trunk", "1.1"]), "Invalid library not excluded!")
Esempio n. 7
0
 def testExcludeByAttributes(self):
     conf = {
       "libraries" :
       {
         "include" : {
           "*" : {}
         },
         "exclude" : {
           "fooLib" : {
             "types" : ["badType"],
             "versions" : ["badVersion"],
             "qooxdoo-versions" : ["badQxVersion"]
           }
         }
       }
     }
     lv = LibraryValidator(conf)
     self.failUnless(lv.isValid("fooLib", "goodType", "goodVersion", ["goodQxVersion", "badQxVersion"]), "Invalid library not excluded!")
     self.failIf(lv.isValid("fooLib", "badType", "goodVersion", ["goodQxVersion"]), "Invalid library not excluded!")
     self.failIf(lv.isValid("fooLib", "goodType", "badVersion", ["goodQxVersion"]), "Invalid library not excluded!")
     self.failIf(lv.isValid("fooLib", "goodType", "goodVersion", ["badQxVersion"]), "Invalid library not excluded!")
Esempio n. 8
0
 def testIncludeExplicit(self):
     conf = {
       "libraries" :
       {
         "include" : {
           "fooLib" : {
             "types" : ["contribution", "widget"],
             "versions" : ["trunk", "1.0"],
             "qooxdoo-versions" : ["1.0.1", "1.1"]
           }
         }
       }
     }
     lv = LibraryValidator(conf)
     
     self.failUnless(lv.isValid("fooLib", "widget", "1.0", ["trunk", "1.1"]), "Valid library deemed invalid!")
     self.failIf(lv.isValid("barLib", "someType", "someVersion", ["qxVer1", "qxVer2"]), "Library with excluded name validated!")
     self.failIf(lv.isValid("fooLib", "backend", "1.0", ["trunk", "1.1"]), "Library with excluded type validated!")
     self.failIf(lv.isValid("fooLib", "contribution", "0.1", ["trunk", "1.1"]), "Library with excluded version validated!")
     self.failIf(lv.isValid("fooLib", "contribution", "1.0", ["trunk"]), "Library with excluded qooxdoo version validated!")
Esempio n. 9
0
 def testNoLibraries(self):
     conf = {}
     lv = LibraryValidator(conf)
     self.failUnless(lv.isValid("someLib", "someType", "someVersion", ["qxVer1", "qxVer2"]))
Esempio n. 10
0
 def testNoConfig(self):
     lv = LibraryValidator()
     self.failUnless(lv.isValid("someLib", "someType", "someVersion", ["qxVer1", "qxVer2"]))