diff options
author | Thomas Waldmann <tw@waldmann-edv.de> | 2014-11-18 18:29:32 +0100 |
---|---|---|
committer | Thomas Waldmann <tw@waldmann-edv.de> | 2014-11-18 18:29:32 +0100 |
commit | 179eefae29491f5d0c0ddf2aca1164dbf2cba4f9 (patch) | |
tree | 4ee71d49a0ebd2f0f3356031abf281445761dade /test | |
parent | 5deb3f9e0f5b7cd81602f90f859c2ec0e4e41eec (diff) | |
download | onionshare-179eefae29491f5d0c0ddf2aca1164dbf2cba4f9.tar.gz onionshare-179eefae29491f5d0c0ddf2aca1164dbf2cba4f9.zip |
pep8: fix empty line counts
top level: 2, else 1
I also advice to not put "pass" into empty classes, but rather a docstring instead of "pass".
Diffstat (limited to 'test')
-rw-r--r-- | test/onionshare_helpers_test.py | 2 | ||||
-rw-r--r-- | test/onionshare_strings_test.py | 3 | ||||
-rw-r--r-- | test/onionshare_test.py | 2 | ||||
-rw-r--r-- | test/onionshare_web_test.py | 2 |
4 files changed, 9 insertions, 0 deletions
diff --git a/test/onionshare_helpers_test.py b/test/onionshare_helpers_test.py index 94febed3..1c7c42d2 100644 --- a/test/onionshare_helpers_test.py +++ b/test/onionshare_helpers_test.py @@ -21,11 +21,13 @@ from nose import with_setup import test_helpers + def test_get_platform_on_tails(): """get_platform() returns 'Tails' when hostname is 'amnesia'""" helpers.platform.uname = lambda: ('Linux', 'amnesia', '3.14-1-amd64', '#1 SMP Debian 3.14.4-1 (2014-05-13)', 'x86_64', '') assert helpers.get_platform() == 'Tails' + def test_get_platform_returns_platform_system(): """get_platform() returns platform.system() when ONIONSHARE_PLATFORM is not defined""" helpers.platform.system = lambda: 'Sega Saturn' diff --git a/test/onionshare_strings_test.py b/test/onionshare_strings_test.py index 011bf406..ab215e0f 100644 --- a/test/onionshare_strings_test.py +++ b/test/onionshare_strings_test.py @@ -21,16 +21,19 @@ import locale from onionshare import strings from nose import with_setup + def test_starts_with_empty_strings(): """creates an empty strings dict by default""" assert strings.strings == {} + def test_load_strings_defaults_to_english(): """load_strings() loads English by default""" locale.getdefaultlocale = lambda: ('en_US', 'UTF-8') strings.load_strings() assert strings._('wait_for_hs') == "Waiting for HS to be ready:" + def test_load_strings_loads_other_languages(): """load_strings() loads other languages in different locales""" locale.getdefaultlocale = lambda: ('fr_FR', 'UTF-8') diff --git a/test/onionshare_test.py b/test/onionshare_test.py index 0edf1be7..76d6b9a0 100644 --- a/test/onionshare_test.py +++ b/test/onionshare_test.py @@ -20,12 +20,14 @@ import socket from onionshare import OnionShare from nose import with_setup + def test_choose_port_returns_a_port_number(): """choose_port() returns a port number""" app = OnionShare() app.choose_port() assert 1024 <= app.port <= 65535 + def test_choose_port_returns_an_open_port(): """choose_port() returns an open port""" app = OnionShare() diff --git a/test/onionshare_web_test.py b/test/onionshare_web_test.py index 963e7e2a..54c4872f 100644 --- a/test/onionshare_web_test.py +++ b/test/onionshare_web_test.py @@ -19,10 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. from onionshare import web from nose import with_setup + def test_generate_slug_length(): """generates a 26-character slug""" assert len(web.slug) == 26 + def test_generate_slug_characters(): """generates a base32-encoded slug""" |