-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add a sample unit test case 2. Fix a flake8 error with too long line width Change-Id: I18ddfc9b85749d1fc427205988479e470031077f Signed-off-by: Baohua Yang <[email protected]>
- Loading branch information
Showing
3 changed files
with
25 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import unittest | ||
|
||
|
||
def add_one(x): | ||
return x + 1 | ||
|
||
|
||
class ChaincodeTest(unittest.TestCase): | ||
""" Test chaincode deploy, invoke and query | ||
""" | ||
def setUp(self): | ||
self.name = b'Hello world!' | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
def test_add_one(self): | ||
self.assertEqual(add_one(3), 4) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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