2121
2222from .util import get_cursor , get_cursors , get_tu
2323
24- kInput = """\
24+ children_test = """\
2525 struct s0 {
2626 int a;
2727 int b;
4141}
4242"""
4343
44- kParentTest = """\
44+ parent_test = """\
4545 class C {
4646 void f();
4747 }
4848
4949 void C::f() { }
5050 """
5151
52- kTemplateArgTest = """\
52+ template_arg_test = """\
5353 template <int kInt, typename T, bool kBool>
5454 void foo();
5555
5656 template<>
5757 void foo<-7, float, true>();
5858 """
5959
60- kBinops = """\
60+ binops = """\
6161 struct C {
6262 int m;
6363 };
@@ -118,7 +118,7 @@ class C {
118118
119119class TestCursor (unittest .TestCase ):
120120 def test_get_children (self ):
121- tu = get_tu (kInput )
121+ tu = get_tu (children_test )
122122
123123 it = tu .cursor .get_children ()
124124 tu_nodes = list (it )
@@ -613,15 +613,15 @@ def test_underlying_type(self):
613613 self .assertEqual (underlying .kind , TypeKind .INT )
614614
615615 def test_semantic_parent (self ):
616- tu = get_tu (kParentTest , "cpp" )
616+ tu = get_tu (parent_test , "cpp" )
617617 curs = get_cursors (tu , "f" )
618618 decl = get_cursor (tu , "C" )
619619 self .assertEqual (len (curs ), 2 )
620620 self .assertEqual (curs [0 ].semantic_parent , curs [1 ].semantic_parent )
621621 self .assertEqual (curs [0 ].semantic_parent , decl )
622622
623623 def test_lexical_parent (self ):
624- tu = get_tu (kParentTest , "cpp" )
624+ tu = get_tu (parent_test , "cpp" )
625625 curs = get_cursors (tu , "f" )
626626 decl = get_cursor (tu , "C" )
627627 self .assertEqual (len (curs ), 2 )
@@ -865,13 +865,13 @@ def test_get_arguments(self):
865865 self .assertEqual (arguments [1 ].spelling , "j" )
866866
867867 def test_get_num_template_arguments (self ):
868- tu = get_tu (kTemplateArgTest , lang = "cpp" )
868+ tu = get_tu (template_arg_test , lang = "cpp" )
869869 foos = get_cursors (tu , "foo" )
870870
871871 self .assertEqual (foos [1 ].get_num_template_arguments (), 3 )
872872
873873 def test_get_template_argument_kind (self ):
874- tu = get_tu (kTemplateArgTest , lang = "cpp" )
874+ tu = get_tu (template_arg_test , lang = "cpp" )
875875 foos = get_cursors (tu , "foo" )
876876
877877 self .assertEqual (
@@ -885,20 +885,20 @@ def test_get_template_argument_kind(self):
885885 )
886886
887887 def test_get_template_argument_type (self ):
888- tu = get_tu (kTemplateArgTest , lang = "cpp" )
888+ tu = get_tu (template_arg_test , lang = "cpp" )
889889 foos = get_cursors (tu , "foo" )
890890
891891 self .assertEqual (foos [1 ].get_template_argument_type (1 ).kind , TypeKind .FLOAT )
892892
893893 def test_get_template_argument_value (self ):
894- tu = get_tu (kTemplateArgTest , lang = "cpp" )
894+ tu = get_tu (template_arg_test , lang = "cpp" )
895895 foos = get_cursors (tu , "foo" )
896896
897897 self .assertEqual (foos [1 ].get_template_argument_value (0 ), - 7 )
898898 self .assertEqual (foos [1 ].get_template_argument_value (2 ), True )
899899
900900 def test_get_template_argument_unsigned_value (self ):
901- tu = get_tu (kTemplateArgTest , lang = "cpp" )
901+ tu = get_tu (template_arg_test , lang = "cpp" )
902902 foos = get_cursors (tu , "foo" )
903903
904904 self .assertEqual (foos [1 ].get_template_argument_unsigned_value (0 ), 2 ** 32 - 7 )
@@ -930,7 +930,7 @@ def test_mangled_name(self):
930930 )
931931
932932 def test_binop (self ):
933- tu = get_tu (kBinops , lang = "cpp" )
933+ tu = get_tu (binops , lang = "cpp" )
934934
935935 operators = {
936936 # not exposed yet
0 commit comments