def test_only_valid_chars(self): """Check that returned value only contains typical commit hash chars.""" sysd_hash = lib.get_sysd_commit() self.assertRegexpMatches(sysd_hash, "^[A-Za-z0-9-]+$")
def test_type(self): """Check that returned value is of the right type.""" sysd_hash = lib.get_sysd_commit() self.assertIsInstance(sysd_hash, str)
def test_len(self): """Check that returned value the normal length for a commit hash.""" sysd_hash = lib.get_sysd_commit() self.assertEqual(len(sysd_hash), 40)
build.update( {"changelog_email": "*****@*****.**"}) else: build.update({"changelog_email": args.changelog_email}) # Depending on pkg type, add appropriate-format changelog date to build def if args.rpm: build.update({"changelog_date": lib.get_changelog_date("rpm")}) if args.deb: build.update({"changelog_date": lib.get_changelog_date("deb")}) # If hash of systemd unit file given add to build def, else use latest hash if args.sysd_commit: build.update({"sysd_commit": args.sysd_commit}) else: build.update({"sysd_commit": lib.get_sysd_commit()}) # Argparse rules imply args.major will only be present for latest_snap # builds and args.download_url will only be present for generic builds. # If doing a latest-snap build, find latest build tarball URL for given # major version and add to build definition. Else, add URL directly. if hasattr(args, "major"): build.update({"download_url": lib.get_snap_url(args.major)}) else: build.update({"download_url": args.download_url}) # Use download_url to find pkg version, add to build def build.update(lib.extract_version(build["download_url"])) # Karaf 3 distros use distribution-karaf-, Karaf 4 uses karaf- build.update({