Code review comment for lp:~unity-team/unity/unity.test-special-keys

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi,

These look great - two small things:

1) Please add "self.dash = Dash()" to AutopilotTest case - you'll see we already have self.launcher and self.switcher etc.

2) please put 'self.dash.ensure_hidden()' into your setup, and remove it from the tests.

3) I'm now being *really* picky, but your docstrings should ideally:
 a) Start with a captial letter and end with a '.'
 b) Describe the test in terms of given input and expected output, so this:

19 + def test_multi_key(self):
20 + """Tests that when the multi_key is pressed it will exepect a sequences"""

would be better written like this:

19 + def test_multi_key(self):
20 + """Pressing Multi_Key must not add add any characters to the search bar."""

and another example - before:

33 + def test_multi_key_o(self):
34 + """Tests the multi_key sequences ^ + o"""

after:

33 + def test_multi_key_o(self):
34 + """Pressing the Multi_Key followed by '^' and 'o' must produce ô."""

Number 3 is something that's good to aim for - I often don't remember to do this myself, but it helps produce tests that are easy to read and verify.

Otherwise, looks great!

« Back to merge proposal