Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_one_time_code(self):
timestamp = 1469184207
code = guard.generate_one_time_code(self.shared_secret, timestamp)
self.assertEquals(code, 'P2QJN')
def _enter_steam_guard_if_necessary(self, login_response: requests.Response) -> requests.Response:
if login_response.json()['requires_twofactor']:
self.one_time_code = guard.generate_one_time_code(self.shared_secret)
return self._send_login_request()
return login_response