[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2777: modernize tests

Tahoe-LAFS trac at tahoe-lafs.org
Tue Nov 24 18:23:14 UTC 2020


#2777: modernize tests
------------------------+-----------------------
     Reporter:  warner  |      Owner:
         Type:  task    |     Status:  new
     Priority:  minor   |  Milestone:  undecided
    Component:  code    |    Version:  1.11.0
   Resolution:          |   Keywords:
Launchpad Bug:          |
------------------------+-----------------------

Old description:

> I'd like to clean up our unit tests.. there are a lot of archaic idioms
> that have crept in (partly because I'm not up-to-date on modern
> practices, partly because the tests were initially written before those
> practices were established). Here are some things that come to mind:
>
> * remove the use of `mock` in favor of proper test doubles
> * switch from trial's TestCase to testtools' TestCase (probably via a
> base class in one of our common modules)
> * replace JUnit-style assertions (`assertEqual(...)`) with "hamcrest"
> style assertions (`assertThat(x, Equals(y))`)
> * switch to `inlineCallbacks` to flatten the control-flow nest of helper
> functions

New description:

 I'd like to clean up our unit tests.. there are a lot of archaic idioms
 that have crept in (partly because I'm not up-to-date on modern practices,
 partly because the tests were initially written before those practices
 were established). Here are some things that come to mind:

 * [ticket:3519 remove the use of `mock` in favor of proper test doubles]
 * switch from trial's TestCase to testtools' TestCase (probably via a base
 class in one of our common modules)
 * replace JUnit-style assertions (`assertEqual(...)`) with "hamcrest"
 style assertions (`assertThat(x, Equals(y))`)
 * switch to `inlineCallbacks` to flatten the control-flow nest of helper
 functions

--

Comment (by exarkun):

 Splitting the mock part of this off into https://tahoe-lafs.org/trac
 /tahoe-lafs/ticket/3519

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2777#comment:12>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list