This repository was archived by the owner on Sep 18, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +1
-19
lines changed
Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Original file line number Diff line number Diff line change 135135import os
136136import pathlib
137137import platform
138- import re
139138import shlex
140139import struct
141140import subprocess
@@ -182,10 +181,6 @@ class GistEmptyTokenError(GistError):
182181 pass
183182
184183
185- class GistInvalidTokenError (GistError ):
186- pass
187-
188-
189184class UserError (Exception ):
190185 pass
191186
@@ -286,13 +281,7 @@ def get_personal_access_token(config):
286281 except configparser .NoOptionError :
287282 raise GistMissingTokenError ("Missing 'token' field in configuration" )
288283
289- token = get_value_from_command (value )
290-
291- match = re .match (r"[0-9a-fA-F]+$" , token )
292- if match is None :
293- raise GistInvalidTokenError ("Invalid personal access token" )
294-
295- return token
284+ return get_value_from_command (value )
296285
297286
298287def alternative_editor (default ):
Original file line number Diff line number Diff line change @@ -34,13 +34,6 @@ def test_get_personal_access_token_empty(config, token):
3434 gist .client .get_personal_access_token (config )
3535
3636
37- @pytest .mark .parametrize ("token" , ["123 123" , "foo" ])
38- def test_get_personal_access_token_invalid (config , token ):
39- config .set ("gist" , "token" , token )
40- with pytest .raises (gist .client .GistInvalidTokenError ):
41- gist .client .get_personal_access_token (config )
42-
43-
4437@pytest .mark .parametrize ("token" , [" 123 " , "123abcABC0987" ])
4538def test_get_personal_access_token_valid (config , token ):
4639 config .set ("gist" , "token" , token )
You can’t perform that action at this time.
0 commit comments