[tor-commits] [bridgedb/main] Clean Up unused BridgeDB mock command
meskio at torproject.org
meskio at torproject.org
Thu Dec 16 11:55:07 UTC 2021
commit 4fe1034287a788eeba9e316962d128c55f54581f
Author: Abhilash KP <abhilashmhaisne at gmail.com>
Date: Mon Dec 6 11:21:57 2021 +0530
Clean Up unused BridgeDB mock command
---
bridgedb/parse/options.py | 12 ------------
bridgedb/test/test_parse_options.py | 34 ----------------------------------
2 files changed, 46 deletions(-)
diff --git a/bridgedb/parse/options.py b/bridgedb/parse/options.py
index 83c0984..475837f 100644
--- a/bridgedb/parse/options.py
+++ b/bridgedb/parse/options.py
@@ -34,8 +34,6 @@ bridgedb.parse.options
|__ SIGHUPOptions - Menu to explain SIGHUP signal handling and usage.
|__ SIGUSR1Options - Menu to explain SIGUSR1 handling and usage.
|
- |__ MockOptions - Suboptions for creating fake bridge descriptors for
- | testing purposes.
\__ MainOptions - Main commandline options parser for BridgeDB.
..
"""
@@ -256,15 +254,6 @@ class BaseOptions(usage.Options):
print(" self['rundir']=%s" % self['rundir'])
-class MockOptions(BaseOptions):
- """Suboptions for creating necessary conditions for testing purposes."""
-
- optParameters = [
- ['descriptors', 'n', 1000,
- '''Generate <n> mock bridge descriptor sets
- (types: netstatus, extrainfo, server)''']]
-
-
class SIGHUPOptions(BaseOptions):
"""Options menu to explain usage and handling of SIGHUP signals."""
@@ -291,6 +280,5 @@ class MainOptions(BaseOptions):
"""Main commandline options parser for BridgeDB."""
subCommands = [
- ['mock', None, MockOptions, "Generate a testing environment"],
['SIGHUP', None, SIGHUPOptions,
"Reload bridge descriptors into running servers"]]
diff --git a/bridgedb/test/test_parse_options.py b/bridgedb/test/test_parse_options.py
index 1071e90..d302918 100644
--- a/bridgedb/test/test_parse_options.py
+++ b/bridgedb/test/test_parse_options.py
@@ -58,40 +58,6 @@ class ParseOptionsTests(unittest.TestCase):
sys.argv = fakeSysArgv
self.assertRaises(SystemExit, options.parseOptions)
- def test_parse_options_parseOptions_with_valid_options(self):
- """:func:`options.parseOptions` should return a
- :class:`options.MainOptions` when given valid commandline arguments.
- """
- fakeSysArgv = ['bridgedb', 'mock', '-n', '-1']
- sys.argv = fakeSysArgv
- opts = options.parseOptions()
- self.assertIsInstance(opts, options.MainOptions)
-
- def test_parse_options_parseOptions_verbosity_quiet_quiet(self):
- """If we use `-q` twice on the commandline, ``opts['verbosity']``
- should equal ``10``.
- """
- fakeSysArgv = ['bridgedb', '-q', '-q', 'mock', '-n', '-1']
- sys.argv = fakeSysArgv
- opts = options.parseOptions()
- self.assertEqual(opts['verbosity'], 10)
-
- def test_parse_options_parseOptions_verbosity_verbose(self):
- """If we use `-v` once on the commandline, ``opts['verbosity']``
- should equal ``50``.
- """
- fakeSysArgv = ['bridgedb', '-v', '-v', 'mock', '-n', '-1']
- sys.argv = fakeSysArgv
- opts = options.parseOptions()
- self.assertEqual(opts['verbosity'], 50)
-
- def test_parse_options_parseOptions_rundir(self):
- """The automatic rundir should be our current directory."""
- fakeSysArgv = ['bridgedb', 'mock', '-n', '-1']
- sys.argv = fakeSysArgv
- opts = options.parseOptions()
- self.assertEqual(opts['rundir'], os.getcwd())
-
def test_parse_options_parseOptions_version(self):
""":func:`options.parseOptions` when given a `--version` argument on
the commandline, should raise SystemExit (after printing some stuff,
More information about the tor-commits
mailing list