diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..45c64bc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: python +python: + - "2.6" + - "2.7" + - "3.3" + - "3.4" + - "3.5" + - "3.5-dev" # 3.5 development branch + - "3.6" + - "3.6-dev" # 3.6 development branch +install: + - pip install -r requirements.txt +script: + - pytest test.py diff --git a/example.py b/example.py index a484bca..095eaf5 100644 --- a/example.py +++ b/example.py @@ -1,3 +1,5 @@ +import pytest + from bclib import bancor bancor_1 = bancor(300000, 1, 0.2) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2a396dc --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pytest==3.0.2 diff --git a/test.py b/test.py new file mode 100644 index 0000000..6d0fd50 --- /dev/null +++ b/test.py @@ -0,0 +1,9 @@ +import pytest + +from bclib import bancor + +bancor_test = bancor(300000, 1, 0.2) +assert bancor_test.issue_by_reserve_token(300) == 299.40179372385245 +assert bancor_test.issue_by_reserve_token(700) == 693.9974382206417 +assert bancor_test.destroy_by_reserve_token(1302) == 1307.966524590907 +assert bancor_test.issue_by_reserve_token(100) == 100.34530853232869