Exemplo n.º 1
0
def test_zero_day_old():
    releases_info = []
    for _, value in example_file["zero_day_releases_old_info"].items():
        releases_info.append(ReleaseTest(value))

    tweet_format = format_tweet.zero_days(list(releases_info),
                                          copy.deepcopy(stored_data))

    assert tweet_format == example_file["zero_day_releases_old_tweet"]
Exemplo n.º 2
0
def test_zero_day():
    releases_info = get_info(example_file["zero_day_releases_table"])

    compare(releases_info, example_file["zero_day_releases_info"])

    tweet_format = format_tweet.zero_days(list(releases_info),
                                          copy.deepcopy(stored_data))

    assert tweet_format == example_file["zero_day_releases_tweet"]
Exemplo n.º 3
0
if sec_content_available_info:
    tweet(
        format_tweet.security_content_available(
            list(sec_content_available_info), stored_data))

# if there were any zero-days fixed
check_zero_days_info = new_releases_info + sec_content_available_info
zero_day_releases_info = []

for release in check_zero_days_info:
    if release.get_num_of_zero_days() > 0:
        zero_day_releases_info.append(release)

if zero_day_releases_info:
    tweet(format_tweet.zero_days(list(zero_day_releases_info), stored_data))

# on midnight check for security content changes made on the previous day
if midnight:
    check_changes_info = releases_info + get_info(all_releases[20:])

    changed_releases_info = []
    for release in check_changes_info:
        if release.get_num_entries_added(
        ) > 0 or release.get_num_entries_updated() > 0:
            changed_releases_info.append(release)

    if changed_releases_info:
        tweet(format_tweet.entry_changes(changed_releases_info))

# new updates should be tweeted last, after all of the other tweets