[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Fix some bugs in unittests



commit a3c6e2aacdffc0fe59f4b5c3f959b04ddf6fa1dd
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Aug 22 16:24:14 2013 +0200

    Fix some bugs in unittests
---
 ooni/oonibclient.py            |    2 ++
 ooni/tests/test_oonibclient.py |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ooni/oonibclient.py b/ooni/oonibclient.py
index d8a8bcd..4f555b2 100644
--- a/ooni/oonibclient.py
+++ b/ooni/oonibclient.py
@@ -5,6 +5,7 @@ import json
 from twisted.internet import defer, reactor
 from twisted.web.client import Agent
 
+from ooni.utils import log
 from ooni.utils.net import BodyReceiver, StringProducer, Downloader
 
 class InputFile(object):
@@ -14,6 +15,7 @@ class InputFile(object):
         self.version = descriptor['version']
         self.author = descriptor['author']
         self.date = descriptor['date']
+        self.description = descriptor['description']
 
         self.file_path = None
 
diff --git a/ooni/tests/test_oonibclient.py b/ooni/tests/test_oonibclient.py
index 65e9e7e..02f9f8f 100644
--- a/ooni/tests/test_oonibclient.py
+++ b/ooni/tests/test_oonibclient.py
@@ -23,8 +23,8 @@ class TestOONIBClient(unittest.TestCase):
     def test_get_input_descriptor(self):
         input_descriptor = yield self.oonibclient.getInput(input_id)
         for key in ['name', 'description', 
-                    'version', 'author', 'date']:
-            self.assertTrue(key in input_descriptor.keys())
+                    'version', 'author', 'date', 'id']:
+            self.assertTrue(hasattr(input_descriptor, key))
 
     @defer.inlineCallbacks
     def test_download_input(self):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits