-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add get_username function (#27)
* chore: added url for get_username function * feat: added get_username function * test: added test for get_username function * chore: updated README.md * chore: added url for get_username function * feat: added get_username function * test: added test for get_username function * chore: updated README.md
- Loading branch information
Showing
7 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
from .api import ( | ||
get_uuid, | ||
get_uuids, | ||
get_username, | ||
get_names, | ||
get_status, | ||
get_blocked_servers, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
get_blocked_servers, | ||
get_uuid, | ||
get_uuids, | ||
get_username, | ||
get_names, | ||
get_profile, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import unittest | ||
|
||
import mojang | ||
|
||
|
||
class TestMojangUsername(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.notch = mojang.get_username("069a79f444e94726a5befca90e38aaf5") | ||
self.unkown = mojang.get_username("069a79f444e94726a5befca90e38aaf6") | ||
|
||
def test_know_uuid(self): | ||
self.assertEqual(self.notch, "Notch") | ||
|
||
def test_unkown_uuid(self): | ||
self.assertEqual(self.unkown, None) | ||
|
||
def test_invalid_uuid(self): | ||
self.assertRaises(ValueError, mojang.get_username, ["thisisnotauuid"]) |