Exemplo n.º 1
0
 def test_has_day_deb(self):
     """Test returned value has a day in it given Deb arg."""
     changelog_date = lib.get_changelog_date("deb")
     self.assertRegexpMatches(changelog_date, "Mon|Tue|Wed|Thu|Fri|Sat|Sun")
Exemplo n.º 2
0
 def test_has_month_deb(self):
     """Test returned value has a month in it given Deb arg."""
     changelog_date = lib.get_changelog_date("deb")
     self.assertRegexpMatches(
         changelog_date, "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec")
Exemplo n.º 3
0
 def test_has_year_deb(self):
     """Test returned value has a year in it given Deb arg."""
     changelog_date = lib.get_changelog_date("deb")
     self.assertRegexpMatches(changelog_date, "[20]\d\d")
Exemplo n.º 4
0
 def test_type_deb(self):
     """Test type of return object is correct given Deb arg."""
     changelog_date = lib.get_changelog_date("deb")
     self.assertIsInstance(changelog_date, str)
Exemplo n.º 5
0
 def test_type_rpm(self):
     """Test type of return object is correct given RPM arg."""
     changelog_date = lib.get_changelog_date("rpm")
     self.assertIsInstance(changelog_date, str)
Exemplo n.º 6
0
        build.update({"changelog_name": "Jenkins"})
    else:
        build.update({"changelog_name": args.changelog_name})

    # Add changelog email to build definition
    if not args.changelog_email:
        # If empty string passed, as happens when a bash script calls this
        # script with unset var, use default
        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)})