trafficcontrol
trafficcontrol copied to clipboard
Refactor Origins Tests
This PR refactors v4/origins_test.go, v3/origins_test.go, in order to make tests more granular, providing transparency on what is being tested and reducing the need to dig through test code to confirm what was tested. In addition this new test structure should also make it easier for new tests to be added as well as reduce redundant code.
- Adds data driven testing
- Descriptive test names
- Sub tests for organization
- Use GoLangs test runner
- Use assert functionality
- Provides fundamental assertions
- Streamlines code
- Reduces nested conditionals
- Adds expectation functions
- Test specific expectations in a clear concise way
- Reusable expectations
Which Traffic Control components are affected by this PR?
- Traffic Ops Tests
What is the best way to verify this PR?
Run TO Integration Tests
PR submission checklist
- [x] This PR has tests
- [ ] This PR has documentation
- [ ] This PR has a CHANGELOG.md entry
- [x] This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)