+"""
+Unit tests for the osrf.json module
+"""
+
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import osrf.json, osrf.net_obj, unittest
-from testobj import TestObject
+
+class TestObject(object):
+ """Test object with basic JSON structures"""
+ def __init__(self):
+ self.int = 1
+ self.string = "two"
+ self.array = [1,2,3,4]
+ self.dict = {'foo': 'bar', 'key': 'value'}
+ self.true = True
+ self.false = False
+ self.null = None
class CheckObjectToJSON(unittest.TestCase):
"""Tests the osrf.json.to_json() method that converts Python objects into JSON"""
+"""
+Unit tests for the osrf.net_obj module
+"""
+
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import osrf.json, osrf.net_obj, unittest
-from testobj import TestObject
class CheckNetworkEncoder(unittest.TestCase):
"""Tests the NetworkEncoder JSON encoding extension"""