def get_by_detect(cls, testmode=False): """ get SctipsList instance by detection automatically. @param boolean testmode @return obj ScriptsList """ scripts_repo = get_repo_for_distro(get_distro(), testmode) scripts_repo.rebase() if not scripts_repo: raise "can not get repositry automatically." blob = scripts_repo.get('scripts.list') if not blob: raise "script.list is not exists in %s" % \ scripts_repo.path return cls.from_blob(blob)
def test_get_repo_from_distro(): _repo = repo.get_repo_for_distro(get_distro(), True) assert 'Repo' == _repo.__class__.__name__, _repo