Esempio n. 1
0
class MockRepo(RepositoryMethodInstall, RepositoryMethodPreInstall,
               RepositoryMethodPostInstall):
    logger = getLogger()
    content = MockContent()
    validate = Validate()
    can_install = False
    data = RepositoryData()
    tree = []
    hacs = get_hacs()

    async def update_repository(self):
        pass
 def __init__(self):
     """Set up HacsRepository."""
     self.hacs = get_hacs()
     self.data = RepositoryData()
     self.content = RepositoryContent()
     self.content.path = RepositoryPath()
     self.information = RepositoryInformation()
     self.repository_object = None
     self.status = RepositoryStatus()
     self.state = None
     self.force_branch = False
     self.integration_manifest = {}
     self.repository_manifest = HacsManifest.from_dict({})
     self.validate = Validate()
     self.releases = RepositoryReleases()
     self.versions = RepositoryVersions()
     self.pending_restart = False
     self.tree = []
     self.treefiles = []
     self.ref = None
Esempio n. 3
0
def test_validate():
    validate = Validate()
    assert validate.success
    validate.errors.append("test")
    assert not validate.success