Beispiel #1
0
    def test_invoke_1(self):
        # given
        target = Target(SpaceName.WEB)
        set_spaces = SetSpaces()
        text_to_find = "luna"
        trigger = Find(text_to_find)
        set_spaces.web_space = "sanguinem-luna-luminarae"
        expected_result = set_spaces.web_space[set_spaces.web_space.
                                               index(text_to_find):]

        # when
        trigger.invoke(target, set_spaces)

        # then
        self.assertEqual(trigger.get_result(), expected_result)
 def __init__(self):
     self.regex = r"[\d]+_[\d]+_[\d]+_[\d]+"
     self.target = Target(SpaceName.WORK)
     self.set_spaces = SetSpaces()
     string = b'aHR0cHM6Ly9jb250ZW50LXN5c3RlbS5nb2cuY29tL29wZW5fbGluay9kb3dubG9hZD9wYXRoPS9vcGVuL2dhbGF4eS9jbGll' \
              b'bnQvZ2FsYXh5X2NsaWVudF8xLjIuNTQuMjcucGtn'
     self.set_spaces.work_space = decode_base64(string)
     self.expected_result = r""
Beispiel #3
0
 def __init__(self):
     self.name = "gog-relative-time"
     self.target = Target(SpaceName.WEB)
     self.set_spaces = SetSpaces()
     self.set_spaces.web_space = decode_base64(
         fetch_file(FetchAttributeTestConst.TEST_FILE_PATH).encode('ascii'))
     content = b"e3sgOjpub3RpZmljYXRpb24uY3JlYXRpb25UaW1lc3RhbXAgfX0="
     self.expected_result = decode_base64(content)
Beispiel #4
0
 def __init__(self):
     self.name = "ng-hide"
     self.target = Target(SpaceName.WEB)
     self.set_spaces = SetSpaces()
     self.set_spaces.web_space = decode_base64(
         fetch_file(FetchAttributeTestConst.TEST_FILE_PATH).encode('ascii'))
     content = b'cHJvZHVjdC5jdXN0b21BdHRyaWJ1dGVzLmN1c3RvbVByaWNlQnV0dG9uVmFyaWFudCA9PSAnam9pbic='
     self.expected_result = decode_base64(content)
Beispiel #5
0
 def __init__(self):
     self.name = "style"
     self.target = Target(SpaceName.WEB)
     self.set_spaces = SetSpaces()
     self.set_spaces.web_space = decode_base64(
         fetch_file(FetchAttributeTestConst.TEST_FILE_PATH).encode('ascii'))
     content = b"d2lkdGg6MDtoZWlnaHQ6MDtvdmVyZmxvdzpoaWRkZW47cG9zaXRpb246Zml4ZWQ7dmlzaWJpbGl0eTpoaWRkZW4="
     self.expected_result = decode_base64(content)
Beispiel #6
0
 def __init__(self):
     self.text_to_find = "c"
     self.set_spaces = SetSpaces()
     self.set_spaces.web_space = "baba"
     self.target = Target(SpaceName.WEB)
     self.expected_result = ""
Beispiel #7
0
 def __init__(self):
     self.text_to_find = "integer"
     self.set_spaces = SetSpaces()
     self.set_spaces.web_space = fetch_file(FindNextTriggerConst.TEST_FILE)
     self.target = Target(SpaceName.WEB)
     self.expected_result = r"integer.\n']"
Beispiel #8
0
 def __init__(self):
     self.string = str()
     self.characters = str()
     self.target = Target(SpaceName.WORK)
     self.set_spaces = SetSpaces()
     self.expected_result = str()
Beispiel #9
0
 def __init__(self):
     self.begin = str()
     self.end = str()
     self.target = Target(SpaceName.WORK)
     self.set_spaces = SetSpaces()
     self.expected_result = str()