Exemple #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")
Exemple #2
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