diff --git a/check_lacked_trans.py b/check_lacked_trans.py index 3ee90ec7..ae57cdfa 100644 --- a/check_lacked_trans.py +++ b/check_lacked_trans.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -''' +""" Check translation lacked or disused. Example: @@ -24,7 +24,7 @@ es disused gui_starting_server 2. load translation key from locale/*.json. 3. compare these. -''' +""" import fileinput, argparse, re, os, codecs, json, sys diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 44b6874f..739862cf 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -29,7 +29,7 @@ class NoTor(Exception): pass class TailsError(Exception): pass def hsdic2list(dic): - "Convert what we get from get_conf_map to what we need for set_options" + """Convert what we get from get_conf_map to what we need for set_options""" return [ pair for pairs in [ [('HiddenServiceDir',vals[0]),('HiddenServicePort',vals[1])] diff --git a/test/onionshare_helpers_test.py b/test/onionshare_helpers_test.py index eb84cc36..94febed3 100644 --- a/test/onionshare_helpers_test.py +++ b/test/onionshare_helpers_test.py @@ -22,12 +22,12 @@ from nose import with_setup import test_helpers def test_get_platform_on_tails(): - "get_platform() returns 'Tails' when hostname is 'amnesia'" + """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" + """get_platform() returns platform.system() when ONIONSHARE_PLATFORM is not defined""" helpers.platform.system = lambda: 'Sega Saturn' assert helpers.get_platform() == 'Sega Saturn' diff --git a/test/onionshare_strings_test.py b/test/onionshare_strings_test.py index f4ad5a87..011bf406 100644 --- a/test/onionshare_strings_test.py +++ b/test/onionshare_strings_test.py @@ -22,17 +22,17 @@ from onionshare import strings from nose import with_setup def test_starts_with_empty_strings(): - "creates an empty strings dict by default" + """creates an empty strings dict by default""" assert strings.strings == {} def test_load_strings_defaults_to_english(): - "load_strings() loads English by default" + """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" + """load_strings() loads other languages in different locales""" locale.getdefaultlocale = lambda: ('fr_FR', 'UTF-8') strings.load_strings("fr") assert strings._('wait_for_hs') == "En attente du HS:" diff --git a/test/onionshare_test.py b/test/onionshare_test.py index 5246d4a1..0edf1be7 100644 --- a/test/onionshare_test.py +++ b/test/onionshare_test.py @@ -21,13 +21,13 @@ from onionshare import OnionShare from nose import with_setup def test_choose_port_returns_a_port_number(): - "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" + """choose_port() returns an open port""" app = OnionShare() # choose a new port app.choose_port() diff --git a/test/onionshare_web_test.py b/test/onionshare_web_test.py index 91a04921..963e7e2a 100644 --- a/test/onionshare_web_test.py +++ b/test/onionshare_web_test.py @@ -20,11 +20,11 @@ from onionshare import web from nose import with_setup def test_generate_slug_length(): - "generates a 26-character slug" + """generates a 26-character slug""" assert len(web.slug) == 26 def test_generate_slug_characters(): - "generates a base32-encoded slug" + """generates a base32-encoded slug""" def is_b32(string): b32_alphabet = "01234556789abcdefghijklmnopqrstuvwxyz"