Skip to content

Commit aa1ef82

Browse files
committed
Test Api._create_order
1 parent 1ad7810 commit aa1ef82

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test_cryptsy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ def test_marketid_should_be_added_as_get_parameter(mock_urlopen, api):
4343
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod&marketid=10'
4444

4545

46+
def test_create_order(api, api_query_mock):
47+
""" Api._create_order should pass the given values onto the api. """
48+
api._create_order(10, 'Buy', 100, 0.10)
49+
api_query_mock.assert_called_with('createorder',
50+
request_data={
51+
'marketid': 10,
52+
'ordertype': 'Buy',
53+
'quantity': 100,
54+
'price': 0.10
55+
})
56+
57+
4658
@pytest.fixture
4759
def mock_create_order(api):
4860
""" Mock the create order so we can check if the correct ordertype is

0 commit comments

Comments
 (0)