Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mate-academy/py-cryptocurrency

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptocurrency

You have some amount of cryptocurrency "Matecoin" in your online wallet. You also bought a program (function get_exchange_rate_prediction) that can predict the exchange rate of your cryptocurrency for the next day.

Inside app/test_main.py, write tests for cryptocurrency_action function. This function takes current_rate - current exchange rate of cryptocurrency. This function should return:

  • "Buy more cryptocurrency", if predicted exchange rate is more than 5% higher from the current.
  • "Sell all your cryptocurrency", if predicted exchange rate is more than 5% lower from the current.
  • "Do nothing", if difference is not that much.

Mock get_exchange_rate_prediction function.

Run pytest app/ to check if function pass your tests.

Run pytest --numprocesses=auto tests/ to check if your tests cover all boundary conditions and pass task tests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.