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
| app = XCUIApplication() | |
| app.launchEnvironment["MOCK_API_CLIENT"] = "true" | |
| app.launchEnvironment["MOCK_GET_USER_ERROR_CODE"] = "402" | |
| app.launch() |
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
| app = XCUIApplication() | |
| app.launchEnvironment["ENV_VAR"] = "Env value" | |
| app.launchArguments = ["-user-id", "12345"] | |
| app.launch() |
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
| client = MockAPIClient() | |
| client.returnValueForGetUser = "MOCK_DATA" |
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
| class MockAPIClient: APIClientProtocol { | |
| var returnValueForGetUser: String | |
| func getUser(id: String) { | |
| return returnValueForGetUser | |
| } | |
| } |
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 Embassy | |
| import EnvoyAmbassador | |
| let loop = try! SelectorEventLoop(selector: try! KqueueSelector()) | |
| let router = Router() | |
| let server = HTTPServer( | |
| eventLoop: loop, | |
| app: router.app, | |
| port: 8080 | |
| ) |
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
| public typealias SWSGI = ( | |
| environ: [String: Any], | |
| startResponse: ((String, [(String, String)]) -> Void), | |
| sendBody: ([UInt8] -> Void) | |
| ) -> Void |
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 time | |
| import threading | |
| import pytest | |
| import psycopg2 | |
| def acquire(conn, poll_period=0.1): | |
| cur = conn.cursor() | |
| while True: |
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/python | |
| import os | |
| import sys | |
| import ast | |
| import textwrap | |
| def parse_setup(setup_filename): | |
| """Parse setup.py and return args and keywords args to its setup | |
| function call |
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 winsound | |
| import time | |
| # Base tune | |
| D_BASE = 264 | |
| # How long a meter is | |
| METRE = 500 | |
| DO = 0 |
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
| #!/bin/sh | |
| FILES=$(git diff HEAD^ HEAD --name-only --diff-filter=ACM | grep -e '\.py$') | |
| for f in $FILES | |
| do | |
| # auto pep8 correction | |
| autopep8 --in-place --ignore=E309,E501,W293 $f | |
| done |