Example #1
0
    def test__get_wordlist_descriptor_exits_in_plugin_path(self):
        # Config plugin
        LocalFile._LocalFile__plugin_path = os.path.abspath(W_DIR)

        _create_plugin_info()

        try:
            wordlist_file = WordListLoader._WordListLoader__get_wordlist_descriptor(W_PATH)

            # Checks if wordlist is file
            wordlist_file == wordlist_file == open(W_PATH, "rU")

            # Checks if wordlist is non file
            pytest.raises(WordlistNotFound, WordListLoader._WordListLoader__get_wordlist_descriptor, "plugin_tmp_dir")
        finally:
            _destroy_plugin_info()
Example #2
0
    def test__get_wordlist_descriptor_exits_abs_path(self):
        # Config plugin
        LocalFile._LocalFile__plugin_path = os.getcwd()

        _create_plugin_info()

        try:
            wordlist_file = WordListLoader._WordListLoader__get_wordlist_descriptor(
                W_PATH)

            # Checks if wordlist is file
            wordlist_file == open(W_PATH, "rU")

            # Checks if wordlist is non file
            pytest.raises(
                WordlistNotFound,
                WordListLoader._WordListLoader__get_wordlist_descriptor, W_DIR)
        finally:
            _destroy_plugin_info()