This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tearDown(self): | |
self.driver.quit() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setUp(self): | |
# creating temporary directory | |
try: | |
os.mkdir('temp') | |
except FileExistsError: | |
pass | |
# creating directory to Append Driver | |
try: | |
os.mkdir('temp/driver') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import unittest | |
from selenium import webdriver | |
from webdriver_manager.chrome import ChromeDriverManager | |
class NewVisitorTest(unittest.TestCase): | |
def setUp(self): | |
# creating temporary directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── config | |
│ ├── asgi.py | |
│ ├── __init__.py | |
│ ├── __pycache__ | |
│ │ ├── __init__.cpython-39.pyc | |
│ │ ├── settings.cpython-39.pyc | |
│ │ ├── urls.cpython-39.pyc | |
│ │ └── wsgi.cpython-39.pyc | |
│ ├── settings.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
def create_proxyauth_extension(proxy_host, proxy_port, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
#print(current_dir) | |
def generate_assets(assets_path: str, output_path: str, filename: str): | |
path_result: list = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Blueprint | |
from flask_restful import Api | |
# API Blueprint | |
from projects.blog.api.views import PostListView, PostDetailView | |
blog_api_blueprint = Blueprint('blog', __name__, template_folder='templates', static_folder='static') | |
blog_api = Api(blog_api_blueprint) | |
# routes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_restful import abort, fields, marshal_with, Resource, reqparse | |
from flask import jsonify | |
from projects.blog.models import Posts | |
# reqparse | |
posts_parser = reqparse.RequestParser() | |
posts_parser.add_argument('title', type=str, help="Title is Required", required=True) | |
posts_parser.add_argument('contents', type=str, help='Contents is Required', required=True) | |
posts_update = reqparse.RequestParser() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run-dev: | |
export FLASK_APP=manage.py && export FLASK_ENV=development && export APP_SETTINGS='projects.config.DevelopmentConfig' && flask run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
class BaseConfig: | |
TESTING: bool = False | |
SECRET_KEY: str = '@Flaskr-MongoSeCretKeyS' | |
DEBUG: bool = False | |
class DevelopmentConfig(BaseConfig): | |
MONGODB_SETTINGS: dict = { |