def get_otp_code(self): try: otp_code = self.otp.get_otp_code() except ConfigException: self.load_otp(force_new=True) otp_code = self.otp.get_otp_code() save_otp(self.otp) return otp_code
def test_otp_config(self): otp_config = load_otp(filename=DATA_DIR + "otp_test.bin") assert otp_config is not None save_otp(otp_config, filename=DATA_DIR + "otp_test2.bin")