Skip to content

Commit

Permalink
Fix to_config_dict implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Jun 19, 2015
1 parent d33b84a commit 8e30699
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion enstaller/auth/_impl.py
Expand Up @@ -193,7 +193,7 @@ def change_auth(self, filename):
fp.write(data)

def to_config_dict(self):
return {"kind": "token", "api_token": self.api_token}
return {"kind": "token", "api_token": self._api_token}

@property
def cant_login_message(self):
Expand Down
8 changes: 8 additions & 0 deletions enstaller/auth/tests/test__impl.py
Expand Up @@ -232,3 +232,11 @@ def test_cant_login_message(self):

# Then
self.assertEqual(auth.cant_login_message, r_message)

def test_to_config_dict(self):
# When
auth = APITokenAuth("bad robot")

# Then
self.assertEqual(auth.to_config_dict(),
{"kind": "token", "api_token": "bad robot"})

0 comments on commit 8e30699

Please sign in to comment.