Ejemplo n.º 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")'))
Ejemplo n.º 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"))'))
Ejemplo n.º 3
0
 def test_tokens_from_declaration_with_an_object_value(self):
     self.assertEquals(["MyAnnotation","(","Value","=","@","MyValue","(",")",")"], annotations.tokens("MyAnnotation(Value=@MyValue())"))
Ejemplo n.º 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()})"))
Ejemplo n.º 5
0
 def test_tokens_from_declaration_with_a_string_value(self):
     self.assertEquals(["MyAnnotation","(","Name","=","\"Snoopy\"",")"], annotations.tokens("MyAnnotation(Name=\"Snoopy\")"))
Ejemplo n.º 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\\"")'))
Ejemplo n.º 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)"))
Ejemplo n.º 8
0
 def test_tokens_from_declaration_with_a_value(self):
     self.assertEquals(["MyAnnotation","(","Five","=","5",")"], annotations.tokens("MyAnnotation(Five=5)"))
Ejemplo n.º 9
0
 def test_tokens_from_declaration_with_whitespaces(self):
     self.assertEquals(["YourAnnotation","(",")"], annotations.tokens("YourAnnotation ( )"))
Ejemplo n.º 10
0
 def test_tokens_from_declaration_with_namespace(self):
     self.assertEquals(["home::MyAnnotation","(",")"], annotations.tokens("home::MyAnnotation()"))
Ejemplo n.º 11
0
 def test_tokens_from_simple_declaration(self):
     self.assertEquals(["MyAnnotation","(",")"], annotations.tokens("MyAnnotation()"))