Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Conversation

@mattmaeda
Copy link
Contributor

Here are the test results. Needed to use the built in test framework for Django to run my tests.

(venv) 15:18:24matt@luna:stockscreener$django-admin test exchange
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
..................................

Ran 34 tests in 0.154s

OK
Destroying test database for alias 'default'...

Copy link
Contributor

@codedragon codedragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice job, Matt. Tests, doc strings, and packaged up. And you are ahead of the game for next quarter with web frameworks.

response = run_screens(history)
message = "Here are your results for {}".format(symbol)
else:
message = "Invalid stock symbol '{}'".format(symbol)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of code in this try block. Think about where you expect to get the ConnectionError, and try to limit the block in the try block to just that. Especially try to avoid conditionals in a try block.


except ValueError as ve:
# If empty
return None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should at least log the exceptions you are catching. And are you sure that you don't want the user to know about them at all?

@codedragon codedragon merged commit 9589fee into UWPCE-PythonCert:master Mar 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants