diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-09-05 08:57:23 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-09-05 08:57:23 -0400 |
commit | eaa7aa28c6bcdc2b7ae1028386cc3ed45b4b662d (patch) | |
tree | 1444e4467f4f4c2a51d2fb192c030bd15d1fb8f7 | |
parent | d73a955d0d2a2c1e30e239617121166d9f42f569 (diff) | |
download | pyopenssl-git-eaa7aa28c6bcdc2b7ae1028386cc3ed45b4b662d.tar.gz |
Start whacking at newline counts for flake8
-rw-r--r-- | OpenSSL/__init__.py | 1 | ||||
-rw-r--r-- | OpenSSL/_util.py | 4 | ||||
-rw-r--r-- | OpenSSL/rand.py | 7 | ||||
-rw-r--r-- | OpenSSL/test/test_rand.py | 17 |
4 files changed, 0 insertions, 29 deletions
diff --git a/OpenSSL/__init__.py b/OpenSSL/__init__.py index fde6fa7..3c80e54 100644 --- a/OpenSSL/__init__.py +++ b/OpenSSL/__init__.py @@ -12,7 +12,6 @@ from OpenSSL.version import ( ) - __all__ = [ "SSL", "crypto", "rand", "tsafe", diff --git a/OpenSSL/_util.py b/OpenSSL/_util.py index b3ea8f7..a4b29e3 100644 --- a/OpenSSL/_util.py +++ b/OpenSSL/_util.py @@ -9,7 +9,6 @@ ffi = binding.ffi lib = binding.lib - def text(charp): """ Get a native string type representing of the given CFFI ``char*`` object. @@ -23,7 +22,6 @@ def text(charp): return native(ffi.string(charp)) - def exception_from_error_queue(exception_type): """ Convert an OpenSSL library failure into a Python exception. @@ -48,7 +46,6 @@ def exception_from_error_queue(exception_type): raise exception_type(errors) - def native(s): """ Convert :py:class:`bytes` or :py:class:`unicode` to the native @@ -70,7 +67,6 @@ def native(s): return s - def path_string(s): """ Convert a Python string to a :py:class:`bytes` string identifying the same diff --git a/OpenSSL/rand.py b/OpenSSL/rand.py index 27d9f7e..65cd597 100644 --- a/OpenSSL/rand.py +++ b/OpenSSL/rand.py @@ -50,7 +50,6 @@ def bytes(num_bytes): return _ffi.buffer(result_buffer)[:] - def add(buffer, entropy): """ Add data with a given entropy to the PRNG @@ -69,7 +68,6 @@ def add(buffer, entropy): _lib.RAND_add(buffer, len(buffer), entropy) - def seed(buffer): """ Alias for rand_add, with entropy equal to length @@ -84,7 +82,6 @@ def seed(buffer): _lib.RAND_seed(buffer, len(buffer)) - def status(): """ Retrieve the status of the PRNG @@ -94,7 +91,6 @@ def status(): return _lib.RAND_status() - def egd(path, bytes=_unspecified): """ Query an entropy gathering daemon (EGD) for random data and add it to the @@ -117,7 +113,6 @@ def egd(path, bytes=_unspecified): return _lib.RAND_egd_bytes(path, bytes) - def cleanup(): """ Erase the memory used by the PRNG. @@ -128,7 +123,6 @@ def cleanup(): _lib.RAND_cleanup() - def load_file(filename, maxbytes=_unspecified): """ Seed the PRNG with data from a file @@ -149,7 +143,6 @@ def load_file(filename, maxbytes=_unspecified): return _lib.RAND_load_file(filename, maxbytes) - def write_file(filename): """ Save PRNG state to a file diff --git a/OpenSSL/test/test_rand.py b/OpenSSL/test/test_rand.py index 3d5c290..3053d1a 100644 --- a/OpenSSL/test/test_rand.py +++ b/OpenSSL/test/test_rand.py @@ -24,7 +24,6 @@ class RandTests(TestCase): self.assertRaises(TypeError, rand.bytes, None) self.assertRaises(TypeError, rand.bytes, 3, None) - def test_insufficientMemory(self): """ :py:obj:`OpenSSL.rand.bytes` raises :py:obj:`MemoryError` if more bytes @@ -32,7 +31,6 @@ class RandTests(TestCase): """ self.assertRaises(MemoryError, rand.bytes, sys.maxsize) - def test_bytes(self): """ Verify that we can obtain bytes from rand_bytes() and @@ -48,7 +46,6 @@ class RandTests(TestCase): exc = self.assertRaises(ValueError, rand.bytes, -1) self.assertEqual(str(exc), "num_bytes must not be negative") - def test_add_wrong_args(self): """ When called with the wrong number of arguments, or with arguments not of @@ -59,14 +56,12 @@ class RandTests(TestCase): self.assertRaises(TypeError, rand.add, None, 3) self.assertRaises(TypeError, rand.add, b("foo"), 3, None) - def test_add(self): """ :py:obj:`OpenSSL.rand.add` adds entropy to the PRNG. """ rand.add(b('hamburger'), 3) - def test_seed_wrong_args(self): """ When called with the wrong number of arguments, or with a non-:py:obj:`str` @@ -76,14 +71,12 @@ class RandTests(TestCase): self.assertRaises(TypeError, rand.seed, None) self.assertRaises(TypeError, rand.seed, b("foo"), None) - def test_seed(self): """ :py:obj:`OpenSSL.rand.seed` adds entropy to the PRNG. """ rand.seed(b('milk shake')) - def test_status_wrong_args(self): """ :py:obj:`OpenSSL.rand.status` raises :py:obj:`TypeError` when called with any @@ -91,7 +84,6 @@ class RandTests(TestCase): """ self.assertRaises(TypeError, rand.status, None) - def test_status(self): """ :py:obj:`OpenSSL.rand.status` returns :py:obj:`True` if the PRNG has sufficient @@ -102,7 +94,6 @@ class RandTests(TestCase): # entropy or not. self.assertTrue(rand.status() in (1, 2)) - def test_egd_wrong_args(self): """ :py:obj:`OpenSSL.rand.egd` raises :py:obj:`TypeError` when called with the wrong @@ -114,7 +105,6 @@ class RandTests(TestCase): self.assertRaises(TypeError, rand.egd, None, 3) self.assertRaises(TypeError, rand.egd, "foo", 3, None) - def test_egd_missing(self): """ :py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the @@ -126,7 +116,6 @@ class RandTests(TestCase): result in expected, "%r not in %r" % (result, expected)) - def test_egd_missing_and_bytes(self): """ :py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the @@ -139,7 +128,6 @@ class RandTests(TestCase): result in expected, "%r not in %r" % (result, expected)) - def test_cleanup_wrong_args(self): """ :py:obj:`OpenSSL.rand.cleanup` raises :py:obj:`TypeError` when called with any @@ -147,7 +135,6 @@ class RandTests(TestCase): """ self.assertRaises(TypeError, rand.cleanup, None) - def test_cleanup(self): """ :py:obj:`OpenSSL.rand.cleanup` releases the memory used by the PRNG and returns @@ -155,7 +142,6 @@ class RandTests(TestCase): """ self.assertIdentical(rand.cleanup(), None) - def test_load_file_wrong_args(self): """ :py:obj:`OpenSSL.rand.load_file` raises :py:obj:`TypeError` when called the wrong @@ -166,7 +152,6 @@ class RandTests(TestCase): self.assertRaises(TypeError, rand.load_file, None, 1) self.assertRaises(TypeError, rand.load_file, "foo", 1, None) - def test_write_file_wrong_args(self): """ :py:obj:`OpenSSL.rand.write_file` raises :py:obj:`TypeError` when called with the @@ -199,7 +184,6 @@ class RandTests(TestCase): # Cleanup os.unlink(path) - def test_bytes_paths(self): """ Random data can be saved and loaded to files with paths specified as @@ -209,7 +193,6 @@ class RandTests(TestCase): path += NON_ASCII.encode(sys.getfilesystemencoding()) self._read_write_test(path) - def test_unicode_paths(self): """ Random data can be saved and loaded to files with paths specified as |