示例#1
0
 def test_tokens_from_declaration_with_two_strings(self):
     self.assertEquals(["MyAnnotation","(","Dog","=",'"Snoopy"',",","Boy","=",'"Charly Brown"',")"], annotations.tokens('MyAnnotation(Dog="Snoopy",Boy="Charly Brown")'))
示例#2
0
 def test_tokens_from_declaration_with_nested_objects_and_two_strings(self):
     self.assertEquals(['Credits','(','Author','=','"Philippe Bourgau"',',','Version','=','@','Version','(','Major','=','"0.9"',')',')'], annotations.tokens('Credits(Author="Philippe Bourgau",Version=@Version(Major="0.9"))'))
示例#3
0
 def test_tokens_from_declaration_with_an_object_value(self):
     self.assertEquals(["MyAnnotation","(","Value","=","@","MyValue","(",")",")"], annotations.tokens("MyAnnotation(Value=@MyValue())"))
示例#4
0
 def test_tokens_from_declaration_with_a_list_of_objects_value(self):
     self.assertEquals(["MyAnnotation","(","Value","=","{","@","MyValue","(",")",",","@","YourValue","(",")","}",")"], annotations.tokens("MyAnnotation(Value={@MyValue(),@YourValue()})"))
示例#5
0
 def test_tokens_from_declaration_with_a_string_value(self):
     self.assertEquals(["MyAnnotation","(","Name","=","\"Snoopy\"",")"], annotations.tokens("MyAnnotation(Name=\"Snoopy\")"))
示例#6
0
 def test_tokens_from_declaration_with_an_escaped_string_value(self):
     self.assertEquals(["MyAnnotation","(","Quote","=",'"\\"Only the goods die young\\""',")"], annotations.tokens('MyAnnotation(Quote="\\"Only the goods die young\\"")'))
示例#7
0
 def test_tokens_from_declaration_with_many_values(self):
     self.assertEquals(["MyAnnotation","(","Five","=","5",",","Six","=","6",")"], annotations.tokens("MyAnnotation(Five=5,Six=6)"))
示例#8
0
 def test_tokens_from_declaration_with_a_value(self):
     self.assertEquals(["MyAnnotation","(","Five","=","5",")"], annotations.tokens("MyAnnotation(Five=5)"))
示例#9
0
 def test_tokens_from_declaration_with_whitespaces(self):
     self.assertEquals(["YourAnnotation","(",")"], annotations.tokens("YourAnnotation ( )"))
示例#10
0
 def test_tokens_from_declaration_with_namespace(self):
     self.assertEquals(["home::MyAnnotation","(",")"], annotations.tokens("home::MyAnnotation()"))
示例#11
0
 def test_tokens_from_simple_declaration(self):
     self.assertEquals(["MyAnnotation","(",")"], annotations.tokens("MyAnnotation()"))