コード例 #1
0
 def test_find_str(self):
     self.assertJson(query.find_str("ABC", "A"),
                     '{"find":"A","findstr":"ABC"}')
コード例 #2
0
 def test_findstr(self):
     self.assertEqual(self._q(query.find_str("ABC", "A")), 0)
     self.assertEqual(self._q(query.find_str("ABC", "A", 0)), 0)
     self.assertEqual(self._q(query.find_str("ABC", "A", 1)), -1)
     self.assertEqual(self._q(query.find_str("a big apple", "a", 2)), 6)