Skip to content

Commit

Permalink
fixed unit tests for pycryptobot model
Browse files Browse the repository at this point in the history
  • Loading branch information
whittlem committed May 27, 2021
1 parent e8f55f7 commit e4bb370
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 137 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,6 @@ graphs/

.vs/

*.log
*.log

tests/unit_tests/data/*.json
15 changes: 7 additions & 8 deletions models/PyCryptoBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ def parse_arguments():
parser.add_argument('--disabletracker', action="store_true", help="disable tracker.csv")

# parse arguments
# args = parser.parse_args()
return vars(parser.parse_args())

# pylint: disable=unused-variable
args, unknown = parser.parse_known_args()
return vars(args)


def to_coinbase_pro_granularity(granularity: int) -> int:
Expand Down Expand Up @@ -190,18 +192,15 @@ def __init__(self, exchange='coinbasepro', filename='config.json'):

except json.decoder.JSONDecodeError as err:
sys.tracebacklimit = 0
print ('Invalid config.json: ' + str(err) + "\n")
sys.exit()
raise ValueError('Invalid config.json: ' + str(err))

except IOError as err:
sys.tracebacklimit = 0
print ('Invalid config.json: ' + str(err) + "\n")
sys.exit()
raise ValueError('Invalid config.json: ' + str(err))

except ValueError as err:
sys.tracebacklimit = 0
print ('Invalid config.json: ' + str(err) + "\n")
sys.exit()
raise ValueError('Invalid config.json: ' + str(err))

def _isCurrencyValid(self, currency):
if self.exchange == 'coinbasepro' or self.exchange == 'binance':
Expand Down
Empty file added tests/unit_tests/data/.gitkeep
Empty file.
Loading

0 comments on commit e4bb370

Please sign in to comment.