Skip to content

Commit

Permalink
Merge pull request #38 from jonatack/add-balance-tests
Browse files Browse the repository at this point in the history
Add BALANCE tests
  • Loading branch information
jonatack authored Aug 30, 2019
2 parents a043070 + 0840421 commit 5e3588f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
- LISP=abcl
# - LISP=clisp
# - LISP=cmucl
- LISP=ecl
# - LISP=ecl

matrix:
fast_finish: true
Expand Down
3 changes: 2 additions & 1 deletion cl-kraken.asd
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"cl-kraken/tests/server-time"
"cl-kraken/tests/spread"
"cl-kraken/tests/ticker"
"cl-kraken/tests/trades")
"cl-kraken/tests/trades"
"cl-kraken/tests/balance")
:perform (test-op (op c) (symbol-call :rove '#:run c)))
9 changes: 7 additions & 2 deletions src/globals.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
(in-package #:cl-kraken/src/globals)

;;; User API key and secret
(defparameter *api-key* "api-key")
(defparameter *api-secret* "api-secret")

(defparameter *api-key*
"J9G291yReQZ4k7JKqaSsSwKCwcQBDdwzQq92z/I8MOu5j3g3SAAJo04c"
"This is an empty account for testing. Replace this value with your API key.")
(defparameter *api-secret*
"Y9T6tmWcRsWryvmi7kpxQcYD5MuMSYpDTCVI1/j4aMnEr+J3QLrU66RTp6KAGmvrsrbs2ycCgjQgELgY9GU5FQ=="
"This is an empty account for testing. Replace this vaule with your API secret.")

;;; Global Parameters

Expand Down
11 changes: 11 additions & 0 deletions tests/balance.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;;;; cl-kraken/tests/balance.lisp

(defpackage #:cl-kraken/tests/balance
(:use #:cl #:rove))
(in-package #:cl-kraken/tests/balance)

(deftest balance
(testing "when passed no keyword params"
(ok (equal (cl-kraken:balance) `(:OBJ ("error")))))
(testing "when passed RAW T"
(ok (string= (cl-kraken:balance :raw t) "{\"error\":[]}"))))
1 change: 0 additions & 1 deletion tests/time.lisp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
;;;; cl-kraken/tests/time.lisp

(in-package #:cl-user)
(defpackage #:cl-kraken/tests/time
(:use #:cl #:rove))
(in-package #:cl-kraken/tests/time)
Expand Down

0 comments on commit 5e3588f

Please sign in to comment.