def test_is_valid_and_unchanged(datafiles, fixed_datetime_monkeypatch): # time after cert validity fixed_datetime_monkeypatch(datetime(2017, 10, 16, 0, 0, 0)) res = cert._is_valid_and_unchanged( str(datafiles / 'cert_example.com.crt'), ['example.com', 'www.example.com', 'test.example.com'], timedelta(0)) assert res is True
def test_is_valid_and_unchanged__expired(datafiles, fixed_datetime_monkeypatch): # time after cert validity fixed_datetime_monkeypatch(datetime(2017, 10, 17, 0, 0, 0)) res = cert._is_valid_and_unchanged(str(datafiles / 'cert_example.com.crt'), ['example.com', 'www.example.com', 'test.example.com'], timedelta(0)) assert res is False