From 9cb591294f7cee0b406261df1bd30792908c7018 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 9 May 2011 13:53:30 +0000 Subject: [PATCH] Fix unit tests for Python in a twistd instance twistd could not find testobj; just inline it. Signed-off-by: Dan Scott git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2245 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/tests/json_test.py | 16 +++++++++++++++- src/python/tests/net_obj_test.py | 5 ++++- src/python/tests/testobj.py | 11 ----------- 3 files changed, 19 insertions(+), 13 deletions(-) delete mode 100644 src/python/tests/testobj.py diff --git a/src/python/tests/json_test.py b/src/python/tests/json_test.py index 3bd78d3..1109f39 100644 --- a/src/python/tests/json_test.py +++ b/src/python/tests/json_test.py @@ -1,8 +1,22 @@ +""" +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""" diff --git a/src/python/tests/net_obj_test.py b/src/python/tests/net_obj_test.py index a4017bd..07e4fc8 100644 --- a/src/python/tests/net_obj_test.py +++ b/src/python/tests/net_obj_test.py @@ -1,8 +1,11 @@ +""" +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""" diff --git a/src/python/tests/testobj.py b/src/python/tests/testobj.py deleted file mode 100644 index e07eafb..0000000 --- a/src/python/tests/testobj.py +++ /dev/null @@ -1,11 +0,0 @@ -class TestObject(object): - 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 - - -- 2.43.2