Skip to content
This repository was archived by the owner on Sep 18, 2023. It is now read-only.

Commit f49f440

Browse files
authored
Merge pull request #102 from jdowner/bugfix
client: remove format check
2 parents 2e8cc77 + 11f1b61 commit f49f440

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

gist/client.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
import os
136136
import pathlib
137137
import platform
138-
import re
139138
import shlex
140139
import struct
141140
import subprocess
@@ -182,10 +181,6 @@ class GistEmptyTokenError(GistError):
182181
pass
183182

184183

185-
class GistInvalidTokenError(GistError):
186-
pass
187-
188-
189184
class 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

298287
def alternative_editor(default):

tests/test_config.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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"])
4538
def test_get_personal_access_token_valid(config, token):
4639
config.set("gist", "token", token)

0 commit comments

Comments
 (0)