예제 #1
0
 def __init__(self, log: Log, name: str, access: int) -> None:
     fakeXmlElementAttribs = {'Name': name, 'Access': AccessType.ToString(access)}
     fakeXmlElement = FakeXmlElementFactory.Create("FakeXmlGenFileDependency", fakeXmlElementAttribs)
     super().__init__(log, fakeXmlElement)
     if self.Name != name:
         raise Exception("Failed to setting fake element name")
     if self.Access != access:
         raise Exception("Failed to setting fake element access")
예제 #2
0
    def __init__(self, log: Log, name: str, scanMethod: Optional[int] = None, blacklist: Optional[List[str]] = None) -> None:
        xmlAttribs = {'Name': name}
        if scanMethod is not None:
            xmlAttribs['ScanMethod'] = ScanMethod.ToString(scanMethod)
        xmlElement = FakeXmlElementFactory.Create("PackageLocation", xmlAttribs)
        if blacklist is not None:
            for blacklistEntry in blacklist:
                xmlBlacklistElement = FakeXmlElementFactory.CreateWithName("Blacklist", blacklistEntry)
                xmlElement.append(xmlBlacklistElement)

        super().__init__(log, xmlElement)
    def __init__(self, log: Log, name: str, version: Optional[Version], targetName: Optional[str], path: Optional[str], ifCondition: Optional[str]) -> None:
        fakeXmlElementAttribs = {'Name': name, 'Type': ExternalDependencyType.ToString(ExternalDependencyType.CMakeFindModern)}
        if version is not None:
            fakeXmlElementAttribs['Version'] = str(version)
        if targetName is not None:
            fakeXmlElementAttribs['TargetName'] = targetName
        if path is not None:
            fakeXmlElementAttribs['Location'] = path
        if ifCondition is not None:
            fakeXmlElementAttribs['If'] = ifCondition

        fakeXmlElement = FakeXmlElementFactory.Create("FakeExternalDep", fakeXmlElementAttribs)
        super().__init__(log, fakeXmlElement)
예제 #4
0
    def __init__(self, log: Log, name: str, version: Optional[Version],
                 targetName: Optional[str], path: Optional[str],
                 ifCondition: Optional[str]) -> None:
        fakeXmlElementAttribs = {'Name': name}
        if version is not None:
            fakeXmlElementAttribs['Version'] = str(version)
        if targetName is not None:
            fakeXmlElementAttribs['TargetName'] = targetName
        if path is not None:
            fakeXmlElementAttribs['Path'] = path
        if ifCondition is not None:
            fakeXmlElementAttribs['If'] = ifCondition

        fakeXmlElement = FakeXmlElementFactory.Create(
            "FakeXmlGenFileFindPackage", fakeXmlElementAttribs)
        super().__init__(log, fakeXmlElement)
예제 #5
0
    def __init__(self,
                 log: Log,
                 name: str,
                 location: str,
                 access: AccessType,
                 extDepType: ExternalDependencyType,
                 debugName: Optional[str] = None,
                 includeLocation: Optional[str] = None,
                 isManaged: bool = False) -> None:
        strType = ExternalDependencyType.ToString(extDepType)
        fakeXmlElementAttribs = {
            'Name': name,
            'Location': location,
            'Access': AccessType.ToString(access),
            "Type": strType
        }  # type: Dict[str, str]

        if debugName is not None:
            fakeXmlElementAttribs['DebugName'] = debugName
        if includeLocation is not None:
            fakeXmlElementAttribs['Include'] = location

        fakeXmlElement = FakeXmlElementFactory.Create("FakeExternalDep",
                                                      fakeXmlElementAttribs)
        super().__init__(log, fakeXmlElement)
        if self.Name != name:
            raise Exception("Failed to setting fake element attribute Name")
        if self.Location != location:
            raise Exception(
                "Failed to setting fake element attribute Location")
        if self.Access != access:
            raise Exception("Failed to setting fake element attribute Access")
        if debugName is not None and self.DebugName != debugName:
            raise Exception(
                "Failed to setting fake element attribute DebugName")
        if includeLocation is not None and self.Include != includeLocation:
            raise Exception(
                "Failed to setting fake element attribute IncludeLocation")
        # Override the value set in the base class
        self.IsManaged = isManaged
예제 #6
0
 def __init__(self, log: Log) -> None:
     xmlElement = FakeXmlElementFactory.Create("Config")
     super().__init__(log, xmlElement)