예제 #1
0
 def test_should_find_symbol_at_start_of_source(self):
     source = "threading.current_thread"
     offset = 13  # threading.cur_|_rent
     result = nativebackend.find_dotted_symbol_backward(source, offset)
     self.assertEqual(result[0], "threading.cur")
     self.assertEqual(source[result[1]:result[2]],
                      "threading.cur")
예제 #2
0
 def test_should_find_empty_string_at_start_of_symbol(self):
     source = "foo(threading.current_thread)"
     offset = 4  # foo(_|_thr
     result = nativebackend.find_dotted_symbol_backward(source, offset)
     self.assertEqual(result[0], "")
     self.assertEqual(source[result[1]:result[2]],
                      "")
예제 #3
0
 def test_should_find_symbol_at_start_of_source(self):
     source = "threading.current_thread"
     offset = 13  # threading.cur_|_rent
     result = nativebackend.find_dotted_symbol_backward(source, offset)
     self.assertEqual(result[0], "threading.cur")
     self.assertEqual(source[result[1]:result[2]],
                      "threading.cur")
예제 #4
0
 def test_should_find_empty_string_at_start_of_symbol(self):
     source = "foo(threading.current_thread)"
     offset = 4  # foo(_|_thr
     result = nativebackend.find_dotted_symbol_backward(source, offset)
     self.assertEqual(result[0], "")
     self.assertEqual(source[result[1]:result[2]],
                      "")
예제 #5
0
 def test_should_find_symbol(self):
     source, offset = source_and_offset("foo(threading.current_th_|_read())")
     result = nativebackend.find_dotted_symbol_backward(source, offset)
     self.assertEqual(result[0], "threading.current_th")
     self.assertEqual(source[result[1] : result[2]], "threading.current_th")
     result = nativebackend.find_dotted_symbol(source, offset)
     self.assertEqual(result[0], "threading.current_thread")
     self.assertEqual(source[result[1] : result[2]], "threading.current_thread")
예제 #6
0
 def test_should_find_symbol(self):
     source, offset = source_and_offset(
         "foo(threading.current_th_|_read())")
     result = nativebackend.find_dotted_symbol_backward(source, offset)
     self.assertEqual(result[0], "threading.current_th")
     self.assertEqual(source[result[1]:result[2]], "threading.current_th")
     result = nativebackend.find_dotted_symbol(source, offset)
     self.assertEqual(result[0], "threading.current_thread")
     self.assertEqual(source[result[1]:result[2]],
                      "threading.current_thread")