commit ded4aefe260fd102d00b03371f546dca0230ea15 Author: kudrom kudrom@riseup.net Date: Mon Aug 4 19:53:34 2014 +0200
Check empty section in config file to avoid AttributeErrors exceptions when parsing the file. --- ooni/settings.py | 2 +- ooni/tests/test_oonicli.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/ooni/settings.py b/ooni/settings.py index 5bc367e..cbf96cb 100644 --- a/ooni/settings.py +++ b/ooni/settings.py @@ -111,7 +111,7 @@ class OConfig(object): configuration = yaml.safe_load(config_file_contents)
for setting in configuration.keys(): - if setting in dir(self): + if setting in dir(self) and configuration[setting] is not None: for k, v in configuration[setting].items(): getattr(self, setting)[k] = v self.set_paths() diff --git a/ooni/tests/test_oonicli.py b/ooni/tests/test_oonicli.py index f4b4a49..92da134 100644 --- a/ooni/tests/test_oonicli.py +++ b/ooni/tests/test_oonicli.py @@ -147,7 +147,6 @@ class TestRunDirector(ConfigTestCase):
@defer.inlineCallbacks def test_http_header_field_manipulation(self): - self.skipTest("Packets to 64.9.255.221:80 seems to be filtered.") def verify_function(entry): assert 'agent' in entry assert 'requests' in entry
tor-commits@lists.torproject.org