-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marcus Lee
authored
Apr 27, 2021
1 parent
5e0caa7
commit 4dfc88d
Showing
7 changed files
with
63 additions
and
7 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
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 |
---|---|---|
|
@@ -14,5 +14,5 @@ | |
install_requires = [ | ||
'requests' | ||
], | ||
license_files=('LICENSE',) | ||
license_files=('LICENSE',), | ||
) |
Empty file.
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,28 @@ | ||
import unittest | ||
|
||
from automint.account import Account | ||
|
||
|
||
class AccountTests(unittest.TestCase): | ||
def test_lovelace_addition(self): | ||
account = Account().add_lovelace(1000) | ||
self.assertEqual(account.get_lovelace(), 1000) | ||
self.assertEqual(account.get_ada(), 0.001) | ||
|
||
def test_account_addition(self): | ||
account_a = Account().add_lovelace(1500000) | ||
account_b = Account().add_lovelace(1500000) | ||
account_c = account_a + account_b | ||
self.assertEqual(account_c.get_lovelace(), 3000000) | ||
self.assertEqual(account_c.get_ada(), 3) | ||
|
||
def test_account_str(self): | ||
account = Account().add_lovelace(1500000) | ||
self.assertEqual(str(account), '1500000') | ||
|
||
account = Account().add_lovelace(1500000).add_native_token('12345.tokenA', 2) | ||
self.assertEqual(str(account), '1500000+"2 12345.tokenA"') | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |