summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* | Update docstring for bridgedb.Bridges.FilteredBridgeSplitter.prepopulateRings().Isis Lovecruft2014-01-05
| |
* | Return True if we were able to prepopulate sub hashrings.Isis Lovecruft2014-01-05
| | | | | | | | | | | | | | | | In bridgedb.Bridges.FilteredBridgeSplitter.prepopulateRings(), we return False if we were unable to prepopulate bridges into the sub hashring for whatever reason. In case some calling function wants to use the boolean return value as a check, we should mirror this logic and return True if prepopulation was successful.
* | Only log netstatus descriptor fields if they were parsed.Isis Lovecruft2014-01-05
| | | | | | | | | | | | * CHANGE bridgedb.Bridges.parseStatusFile() to only log networkstatus descriptor fields if the parsers were actually able to parse them. Otherwise we waste a lot of log lines with blank values.
* | Merge branch 'fix/9873-convert-old-unittests_r3' into developIsis Lovecruft2013-12-20
|\ \
| * | Remove unused Travis CI env variable.fix/9873-convert-old-unittests_r3Isis Lovecruft2013-12-20
| | | | | | | | | | | | [ci skip]
| * | Actually skip that unittest that hangs in travis CI.Isis Lovecruft2013-12-20
| | |
| * | Skip testDiscountAndPruneBridgeHistory() unittest in travis CI.Isis Lovecruft2013-12-20
| | |
| * | Cat bridgedb.log out after a travis CI run.Isis Lovecruft2013-12-20
| | |
| * | Fix missing word in docstring.Isis Lovecruft2013-12-20
| | |
| * | Small .travis.yml changes to reports, coverage runs, and geoip deps.Isis Lovecruft2013-12-20
| | |
| * | Ignore doc/coverage-html directory.Isis Lovecruft2013-12-20
| | |
| * | Change str → basestring in lib/bridgedb/test/test_persistent.py unittest.Isis Lovecruft2013-12-20
| | |
| * | Turn doctest we skip in bridgedb.test.util into a Sphinx codeblock.Isis Lovecruft2013-12-20
| | | | | | | | | | | | It was still failing.
| * | Fix docs in test_Tests.py and deprecated.py to use :api: for twisted.Isis Lovecruft2013-12-20
| | |
| * | Skip doctest in bridgedb.test.util; cannot make doctest classes.Isis Lovecruft2013-12-20
| | |
| * | Removed doctest from bridgedb.test.ParseNetworkStatusRLineTests.Isis Lovecruft2013-12-20
| | |
| * | Fix doctest for bridgedb.crypto.getKey().Isis Lovecruft2013-12-20
| | |
| * | Add Sphinx param docs for bridgedb.Time.IntervalSchedule.Isis Lovecruft2013-12-20
| | |
| * | Fix docstring context for bridgedb.Time.IntervalSchedule.Isis Lovecruft2013-12-20
| | |
| * | Add Sphinx param docs for bridgedb.Dist.uniformMap().Isis Lovecruft2013-12-20
| | |
| * | Fix docstring context for bridgedb.Dist.uniformMap().Isis Lovecruft2013-12-20
| | |
| * | Add Sphinx param docs for bridgedb.Bridges.is_valid_ip().Isis Lovecruft2013-12-20
| | |
| * | Fix doctest context in bridgedb.Bridges.is_valid_ip().Isis Lovecruft2013-12-20
| | |
| * | The logging module in py2.6 doesn't have logging.warnings.Isis Lovecruft2013-12-20
| | |
| * | Decrease the noisyness of bridgedb.test.fileCheckDecorator().Isis Lovecruft2013-12-20
| | |
| * | Change assertion in Tests.py to check for new class.Isis Lovecruft2013-12-20
| | |
| * | Only test fakeBridges with valid IPs in Tests.py.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | The random IP address generation in these old unittests would mean that some tests would unreproducibly fail due to their fakeBridge()s using invalid IP addresses.
| * | Fix Tests.randomIP*String() methods to enclose in brackets explicitly.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | This was causing problems for the parsers, some of which expect an IPv6 address without brackets, and others with brackets. It's easier if we're explicit about whether we're putting brackets around an address.
| * | Fix bridgedb.Tests.randomIP*() methods to return the correct IP type.Isis Lovecruft2013-12-20
| | |
| * | One tiny PEP8 fix in bridgedb.Tests.Isis Lovecruft2013-12-20
| | |
| * | Add test_Tests.TrialAdaptedDoctests class.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class uses the dynamic doctest discovery mechanism, `test_Tests.generateTrialAdaptedDoctestSuite`, to run all discovered doctests. The generated methodnames in this `TestCase` correspond to location in the source code where the doctest was discovered. It also (somewhat) magically manages to print exception/failure tracebacks for failed doctests in a manner which is compatible with twisted.trial. The printed tracebacks will tell you: 1. Where the doctest is, and which line caused the exception. 2. What the expected result was supposed to be (according to the doctest), compared with what it actually was when the doctest code was run.
| * | Add test_Tests.MonkeypatchedOldUnittests class.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | This is precisely the same as `test_Tests.OldUnittests`, except that it re-runs all of the old unittests in lib/bridgedb/Tests.py with old code from `bridgedb.test.deprecated` to assist in finding regressions.
| * | Rewrite test_Tests.OldUnittests to use DynamicTestCaseMeta.Isis Lovecruft2013-12-20
| | |
| * | Add dynamic TestCase class generator.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not *strictly* necessary; however, the previous manner that I had devised for running the old unittests in lib/bridgedb/Tests.py had a small problem: it ran *all* the tests in lib/bridgedb/Tests.py as a single trial test. This meant that if a single test from Tests.py failed, the whole test would fail, which doesn't give us very fine-grained reporting, especially if there were multiple failures (the whole thing would fail when the first one failed). To fix that, it would be necessary to create one `TestCase` "test_*" method per original unittest. Each individual unittest would also need to be wrapped with a `twisted.trial.unittest.PyUnitResultAdapter`, in order for twisted.trial to be able to capture tracebacks and `failure.Failures` correctly. Additionally, it would be nice if we could simply take each `TestCase` method from the original unittests and reuse their method names (so that we know exactly which one of the original unittests is being run); therefore, the methods need to be wrapped yet again to reassign dynamic instancemethod names. (Normally, dynamically mucking around with Python's namespace is a BadIdea™, but it turns out not only that this works, but that it *also* works with the dynamically discovered doctests from `test_Tests.generateTrialAdaptedDoctestSuite()` as well!) I mostly wanted to see if I could do it. Turns out, I can, and it seems to work well. This black-magic encrusted monster I've munged together, `DynamicTestCaseMeta`, works in the following manner: 1. It generates dynamic methodnames with a given `methodPrefix` 2. It generates corresponding methods for a `twisted.trial.unittest.TestCase` base class. 3. Next, it wraps the generated methods. Sometimes, depending on the base class, it wraps them multiple times. It also allows further layers of wrapping, i.e. the `MonkeyPatcher` returned from `monkeypatchTests()` still works. 4. Then, it assigns each generated methodname and method pair, using the special __new__() constructor, to the base class *when the base class is compiled* (i.e. when the test_Tests module is first imported into a Python interpreter). Therefore, each time you initialise a base class which uses `DynamicTestCaseMeta` as its __metaclass__, every initialised instance will have the *same* generated code, because the code which is generated is decided at compile time, not access time. * ADD the terrifying `test_Tests.DynamicTestCaseMeta` class generator. post scriptum: Take that, C++! :P
| * | Add test_Tests.monkeypatchTests() to setup regression tests.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | This function creates a `twisted.python.monkey.MonkeyPatcher` which will add deprecated code from `bridgedb.test.deprecated` back in, so that a TestCase class can run its tests on pre-refactored code to test for regressions.
| * | Add test_Tests.generateTrialAdaptedDoctestsSuite().Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | This function discovers doctests within the directory that BridgeDB was installed within, and then it builds a `twisted.trial.unittest.TestSuite` from all discovered doctests.
| * | Rename `TrialAdaptedOldUnittests` → `OldUnittests`.Isis Lovecruft2013-12-20
| | |
| * | Remove imports for bridgedb.Tests classes; import whole module.Isis Lovecruft2013-12-20
| | |
| * | Add another __future__ import to test_Tests.py.Isis Lovecruft2013-12-20
| | |
| * | Add `_trial_temp.lock` to .gitignore.Isis Lovecruft2013-12-20
| | |
| * | Add test.deprecated module for regression testing with original code.Isis Lovecruft2013-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ADD `lib/bridgedb/test/deprecated.py` which contains old classes and functions (before refactoring), so that they can be `twisted.python.monkey.MonkeyPatched`ed into `bridgedb.test.test_Tests` (and perhaps other tests). This causes the unittests to function as regression tests when code is refactored, so that (hopefully) we can find regression bugs faster. In the future, we *should* be able to use `twisted.python.deprecate` to deprecate function and classes in place (i.e. without removing them from their original files). I didn't think to do this until long after these had been removed, and re-adding deprecated code back into BridgeDB's modules seems like it would be confusing. That said, it is *also* fine, in the future, to actually move deprecated code into `bridgedb.test.deprecated` (just make sure to change all references to the original in the codebase!). However, doing this *does* mean you'll need to do quite a bit more complicated monkeypatching in `bridgedb.test.test_Tests.py`, or any other future regression testsuites.
| * | Change `Bridges.parseORAddressLine`→`networkstatus.parseALine` in Tests.py.Isis Lovecruft2013-12-20
| | |
| * | Add trial runner/report class adapter for old unittests.Isis Lovecruft2013-12-20
|/ / | | | | | | | | | | | | | | | | | | | | This adds a new unittest file, `lib/bridgedb/test/test_Tests.py`, which runs the old unittests in `lib/bridgedb/Tests.py` with a unittest report adapter that is compatible with twisted.trial. It uses the underlying SynchronousTestCase wrapper for the stdlib `unittest.TestCase` (which the tests in `lib/bridgedb/Tests.py` use). * ADDS a trial runner for BridgeDB's old unittests. * FIXES #9873
* | Merge branch 'hotfix/9462B-netstatus-returns-None' into developIsis Lovecruft2013-12-20
|\ \
| * | Fix field names in ParseNetworkStatusALineTests.test_missingPrefix().hotfix/9462B-netstatus-returns-NoneIsis Lovecruft2013-12-20
| | |
* | | Merge branch 'hotfix/9462B-netstatus-returns-None' into developIsis Lovecruft2013-12-20
|\ \ \ | |/ /
| * | Fix ParseNetworkStatusALineTests.test_missingPrefix unittest.Isis Lovecruft2013-12-20
| | |
* | | Merge branch 'fix/10446-geoip-module' into developIsis Lovecruft2013-12-20
|\ \ \
| * | | Update README to reflect pygeoip module changes.fix/10446-geoip-moduleIsis Lovecruft2013-12-20
| | | |
| * | | Use pygeoip instead of GeoIP in HTTPServer.py.Isis Lovecruft2013-12-20
|/ / / | | | | | | | | | * FIXES #10446