• 
      
    Fish Trophy

    chipx86 got a fish trophy!

    Fish Trophy

    Move away from most fixtures for the webapi tests.

    Review Request #4554 — Created Sept. 10, 2013 and submitted — Latest diff uploaded

    Information

    Review Board
    master

    Reviewers

    Move away from most fixtures for the webapi tests.

    This removes the usage of the test_reviewrequests and most of the
    test_scmtools fixtures from the webapi unit tests. Instead, these test
    suites now use the new TestCase class's utility methods for creating
    test objects.

    It also removes a lot of the older utility methods for creating dummy
    objects that went through the API. Each of these requests contributed
    50-100ms of time, which added up.

    With the test suite as it originally was, on my machine, it took roughly
    159 seconds to complete. After this and the previous changes, it drops
    to around ~88.

    Unit tests are much clearer now. Instead of having to know how fixtures
    are set up, or tracing through a bunch of API requests, you can just
    read the unit tests and see what they're doing.

    In total, 1,823 lines of code have been deleted in these changes.

    Unit tests pass.

    Compared speeds and saw that tests are down to around 88 lines.

    Ran pyflakes.