test_login.py 895 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. """Test module"""
  2. from rival_regins_wrapper import Client
  3. def main():
  4. """Main method"""
  5. user = input("User: ")
  6. passw = input("Pass: ")
  7. method = input("Method: ")
  8. client = Client(method, user, passw, show_window=True)
  9. print(client.var_c)
  10. action = input("Action: ")
  11. action_dict = {
  12. "market": market,
  13. "article": article
  14. }
  15. if action in action_dict:
  16. action_dict[action](client)
  17. def market(client):
  18. """Get all market prices"""
  19. # print(client.market_info('oil'))
  20. market_info = client.get_all_market_info()
  21. for i in market_info:
  22. print("")
  23. print(i.upper())
  24. print("#"*len(i))
  25. for j in market_info[i]:
  26. print(j.upper() + ':' + market_info[i][j])
  27. def article(client):
  28. """Create article"""
  29. client.create_article("Test", "Whoops")
  30. if __name__ == "__main__":
  31. main()