Example #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
Example #2
0
 def generate(self, _):
     self.value = "{{ \"{}\": \"{}\" }}".format(Random.string(),
                                                Random.string())
Example #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()
Example #4
0
 def generate(self, _):
     self.value = Random.string()
Example #5
0
def regex():
    if Random.bool():
        return Random.string()
    else:
        return Random.choice(["^\\d+$", "^[a-zA-Z0-9]*$", ".*"])
Example #6
0
def accept():
    return Random.choice([Random.string(), "audio/*", "video/*", "image/*"])
Example #7
0
 def generate(self, _):
     if len(self.strings):
         self.value = Random.choice(self.strings)
     else:
         self.value = Random.string()
Example #8
0
 def generate(self, _):
     self.value = "[\"{}\"]".format(Random.string())