def test_increment_integer(self): # test the increment integer function key = Fernet.generate_key() fernet = Fernet(key) # test normal behavior for i in range(100): assert fernet._increment_integer(i) == i + 1 # test edge case i = 2**128-1 assert fernet._increment_integer(i) == 0 # test big integer with pytest.raises(AssertionError) as e: fernet._increment_integer(2**128) # test negative integer with pytest.raises(AssertionError) as e: fernet._increment_integer(-1)