Skip to content

Commit

Permalink
Fix check problem
Browse files Browse the repository at this point in the history
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
yeasy committed Jan 27, 2017
1 parent 3dfbd8e commit 02e3796
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

STATIC_FOLDER = os.getenv("STATIC_FOLDER", "themes/basic/static")
TEMPLATE_FOLDER = os.getenv("TEMPLATE_FOLDER", "themes/basic/templates")
app = Flask(__name__, static_folder=STATIC_FOLDER, template_folder=TEMPLATE_FOLDER)
app = Flask(__name__, static_folder=STATIC_FOLDER,
template_folder=TEMPLATE_FOLDER)

app.config.from_object('config.DevelopmentConfig')
app.config.from_envvar('CELLO_CONFIG_FILE', silent=True)
Expand Down
22 changes: 22 additions & 0 deletions test/unit/demo_test.py
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()
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ skip_missing_interpreters=True
deps = mock
pytest
-r{toxinidir}/src/requirements.txt
commands = py.test
--cov=hyperledger {posargs:test/unit}
commands = py.test {posargs:test/unit}
#commands = py.test

[testenv:flake8]
Expand Down

0 comments on commit 02e3796

Please sign in to comment.