def test__bool_true(self): input = True expected_output = "true" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__null_chararray(self): input = None expected_output = "|-_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__num(self): input = 1234 expected_output = "1234" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__map(self): input = {'a': 1, 'b':'z'} expected_output = "|[_a#1|,_b#z|]_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__tuple(self): input = (1234, "abc") expected_output = "|(_1234|,_abc|)_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__bag(self): input = [1234, "abc"] expected_output = "|{_1234|,_abc|}_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__short_tuple(self): input = (1, ) expected_output = "|(_1|)_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__datetime(self): d = datetime.now() input = (d, ) expected_output = "|(_%s|)_" % d.isoformat() out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__bool_false(self): input = False expected_output = "false" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__nested_tuple(self): input = [(32, 12, 'abc'), 32, ['abc', 'def', 'ghi']] expected_output = "|{_|(_32|,_12|,_abc|)_|,_32|,_|{_abc|,_def|,_ghi|}_|}_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__datetime(self): d = datetime.now() input = (d,) expected_output = "|(_%s|)_" % d.isoformat() out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__map(self): input = {'a': 1, 'b': 'z'} expected_output = "|[_a#1|,_b#z|]_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__short_tuple(self): input = (1,) expected_output = "|(_1|)_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__bug(self): input = (None, 32, 98765432109876543210L) expected_output = "|(_|-_|,_32|,_98765432109876543210|)_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__nested_tuple(self): input = [(32,12,'abc'), 32, ['abc', 'def', 'ghi']] expected_output = "|{_|(_32|,_12|,_abc|)_|,_32|,_|{_abc|,_def|,_ghi|}_|}_" out = controller.serialize_output(input) self.assertEquals(expected_output, out)
def test__empty_chararray(self): input = "" expected_output = "" out = controller.serialize_output(input) self.assertEquals(expected_output, out)