def test_find_str(self): self.assertJson(query.find_str("ABC", "A"), '{"find":"A","findstr":"ABC"}')
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)