def test_get_build_date(): assert utils.get_build_date('20180102123456') == datetime( 2018, 1, 2, 12, 34, 56, 0, pytz.utc ) assert utils.get_build_date(20180102123456) == datetime( 2018, 1, 2, 12, 34, 56, 0, pytz.utc )
def get_all_versions(): with open('tests/data/buildhub/get.json', 'r') as In: versions = json.load(In) for prod, i in versions.items(): for chan, j in i.items(): for x in j: x[0] = utils.get_build_date(x[0]) if 'esr' not in i: i['esr'] = [] return versions
def test_get_useful_bids(): buildhub_bids = [ (utils.get_build_date('19750316010203'),), (utils.get_build_date('19760316010203'),), (utils.get_build_date('19770316010203'),), (utils.get_build_date('19780316010203'),), (utils.get_build_date('19790316010203'),), (utils.get_build_date('19800316010203'),), ] socorro_bids = {buildhub_bids[0][0], buildhub_bids[2][0], buildhub_bids[4][0]} expected = [buildhub_bids[0], buildhub_bids[2], buildhub_bids[4], buildhub_bids[5]] assert dc.get_useful_bids(buildhub_bids, socorro_bids) == expected