Exemplo n.º 1
0
 def mutate_text(self) -> bool:
     if Random.bool():
         if docs.is_svg_text_element(self.name):
             self.last_text = Random.string()
             return True
         return False
     else:
         if self.parent is None or docs.is_svg_text_element(
                 self.parent.name):
             self.ahead_text = Random.string()
             return True
         return False
Exemplo n.º 2
0
 def generate(self, _):
     self.value = "{{ \"{}\": \"{}\" }}".format(Random.string(),
                                                Random.string())
Exemplo n.º 3
0
 def generate_text(self):
     if docs.is_svg_text_element(self.name) and Random.selector(5) == 0:
         self.last_text = Random.string()
     if self.parent is None or docs.is_svg_text_element(self.parent.name) and \
             Random.selector(5) == 0:
         self.ahead_text = Random.string()
Exemplo n.º 4
0
 def generate(self, _):
     self.value = Random.string()
Exemplo n.º 5
0
def regex():
    if Random.bool():
        return Random.string()
    else:
        return Random.choice(["^\\d+$", "^[a-zA-Z0-9]*$", ".*"])
Exemplo n.º 6
0
def accept():
    return Random.choice([Random.string(), "audio/*", "video/*", "image/*"])
Exemplo n.º 7
0
 def generate(self, _):
     if len(self.strings):
         self.value = Random.choice(self.strings)
     else:
         self.value = Random.string()
Exemplo n.º 8
0
 def generate(self, _):
     self.value = "[\"{}\"]".format(Random.string())