Пример #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()"))