Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug in GenericRequest.to_dict() (#391)
- Loading branch information
Showing
3 changed files
with
14 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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
from unittest import TestCase | ||
|
||
from xrpl.models.requests import Fee | ||
from xrpl.models.requests import Fee, GenericRequest | ||
|
||
|
||
class TestRequest(TestCase): | ||
def test_to_dict_includes_method_as_string(self): | ||
tx = Fee() | ||
value = tx.to_dict()["method"] | ||
self.assertEqual(type(value), str) | ||
|
||
def test_generic_request_to_dict_sets_command_as_method(self): | ||
command = "validator_list_sites" | ||
tx = GenericRequest(command=command).to_dict() | ||
self.assertDictEqual(tx, {"method": command}) |
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