示例#1
0
 def test_empty(self):
     self.failUnless(jsonops.array_slice([], 1, 2) == jsonops.pprint([]))
示例#2
0
 def test_empty(self):
     self.failUnless(jsonops.array_enumerate([], "4") == jsonops.pprint({}))
示例#3
0
 def test_normal(self):
     self.failUnless(jsonops.array_enumerate({"a", "b"}, 4) == jsonops.pprint({4: "a", 5: "b"}))
示例#4
0
 def test_empty(self):
     self.failUnless(jsonops.object_values({}) == jsonops.pprint([]))
示例#5
0
 def test_normal(self):
     self.failUnless(jsonops.object_values({"1": "a", "2": "b"}) == jsonops.pprint(["a", "b"]))
示例#6
0
 def test_out_of_range(self):
     self.failUnless(jsonops.array_tail(range(3), 7) == jsonops.pprint([]))
示例#7
0
 def test_strings(self):
     self.failUnless(jsonops.object_get({"f": "b", "z": "q"}, "z") == jsonops.pprint("q"))
示例#8
0
 def test_one(self):
     self.failUnless(jsonops.array_tail([1], 0) == jsonops.pprint([1]))
示例#9
0
 def test_normal(self):
     self.failUnless(jsonops.array_tail(range(9), 7) == jsonops.pprint([7, 8]))
示例#10
0
 def test_out_of_range(self):
     self.failUnless(jsonops.array_head(range(3), 11) == jsonops.pprint([0, 1, 2]))
示例#11
0
 def test_empty(self):
     self.failUnless(jsonops.array_tail([], 1) == jsonops.pprint([]))
示例#12
0
 def test_normal(self):
     self.failUnless(jsonops.array_head(range(9), 3) == jsonops.pprint([0, 1, 2]))
示例#13
0
 def test_one(self):
     self.failUnless(jsonops.array_head([1], 1) == jsonops.pprint([1]))
示例#14
0
 def test_reverse_range(self):
     self.failUnless(jsonops.array_slice(range(10), 9, 1) == jsonops.pprint([]))
示例#15
0
 def test_normal_slice(self):
     self.failUnless(jsonops.array_slice(range(10), 3, 5) == jsonops.pprint([3, 4]))
示例#16
0
 def test_one(self):
     self.failUnless(jsonops.array_slice([1], 0, 1) == jsonops.pprint([1]))