예제 #1
0
def test_hide_api_key_repr():
    assert hide_api_key_repr(Settings(
        'secret', 'username')) == ('Settings(\n'
                                   '    api_key=...,\n'
                                   "    username='******',\n"
                                   '    fork=False,\n'
                                   "    base_url='https://api.github.com',\n"
                                   ')')
예제 #2
0
def test_hide_api_key_different_key():
    class NT(NamedTuple):
        username: str
        password: str

    assert hide_api_key_repr(NT('user', 'pass'),
                             key='password') == ('NT(\n'
                                                 "    username='******',\n"
                                                 '    password=...,\n'
                                                 ')')
예제 #3
0
 def __repr__(self) -> str:
     return hide_api_key_repr(self)
예제 #4
0
 def __repr__(self) -> str:
     return hide_api_key_repr(self, key='app_password')