예제 #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()"))