Skip to content

Conversation

@HabenFoto
Copy link

@HabenFoto HabenFoto commented Mar 16, 2020

Assignment Submission: Slack CLI

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
How did you go about exploring the Slack API? Did you learn anything that would be useful for your next project involving an API? First by reading the API documentation and then using Postman to see the results. I learned how useful Postman is to look for responses and how parameters change alters the responses as well.
Give a short summary of the request/response cycle. Where does your program fit into that scheme? The request/response cycle is when a client sends a request and receives a response from a server. The command-line program is a client and Slack API's server is the server. In my program, the CLI gives the user/client an opportunity to start the cycle of request/response. It (the program) then sends the request to the Slack server and the Slack server sends a response back to the user using the driver code.
How does your program check for and handle errors when using the Slack API? The program raises SlackAPIErrors if the response is not "OK" or "!200”.
How did the design and organization of your project change over time? Initially, I thought about having a module but decided to just use the 'Recipient Class' as an Abstract class and have ‘User' and ‘Channel' classes inherit from it. I had ‘show_details' in 'Recipient Class' that ended up being moved to my 'Workspace Class'.
Did you use any of the inheritance idioms we've talked about in class? How? Yes. The 'Recipient Class' is the parent class (abstract class) for ‘User' and 'Channel Class'. I used polymorphism to send a message to both users and channels. And I also used a template method (i.e.) to raise a NotImplementError.
How does VCR aid in testing a program that uses an API? The VCR is a great way of recording and reusing API responses to our testing. It records each external API request/response in a test suit the first time it is run, stores the data in a cassette file and then replay the cassette on each test run. This means that each test run of the test suit doesn’t make any external calls, making the suit run much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant