This file contains 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 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 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 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 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 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 datetime | |
begin = datetime.time(11, 48) | |
end = datetime.time(12, 15) | |
#timedelta = end - begin | |
#print timedelta | |
timedelta = datetime.timedelta(seconds=26) | |
def time_add(t, delta): |
This file contains 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
EEEEEEEEEEEEEEE | |
====================================================================== | |
ERROR: Failure: ImportError (cannot import name sample_customer_2) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "C:\GitHub\billy\env\lib\site-packages\nose-1.3.0-py2.7.egg\nose\loader.py", line 413, in loadTestsFromName | |
addr.filename, addr.module) | |
File "C:\GitHub\billy\env\lib\site-packages\nose-1.3.0-py2.7.egg\nose\importer.py", line 47, in importFromPath | |
return self.importFromDir(dir_path, fqname) | |
File "C:\GitHub\billy\env\lib\site-packages\nose-1.3.0-py2.7.egg\nose\importer.py", line 94, in importFromDir |
This file contains 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
EEEEEEEEEEEEEEEE | |
====================================================================== | |
ERROR: Failure: InvalidRequestError (Table 'charge_subscription' is already defined for this MetaData instance. Specify 'extend_existing=True' to redefine options and columns on an existing Table object.) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "C:\GitHub\billy\env\lib\site-packages\nose-1.3.0-py2.7.egg\nose\loader.py", line 413, in loadTestsFromName | |
addr.filename, addr.module) | |
File "C:\GitHub\billy\env\lib\site-packages\nose-1.3.0-py2.7.egg\nose\importer.py", line 47, in importFromPath | |
return self.importFromDir(dir_path, fqname) | |
File "C:\GitHub\billy\env\lib\site-packages\nose-1.3.0-py2.7.egg\nose\importer.py", line 94, in importFromDir |
This file contains 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 csv | |
f2_ids = set() | |
f2 = open('file2.txt', 'rt') | |
f2_reader = csv.reader(f2) | |
for row in f2_reader: | |
f2_ids.add(row[0]) | |
f1 = open('file1.txt', 'rt') | |
for line in f1.readlines(): |
This file contains 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
for line in file.readlines(): | |
parts = line.split(':') | |
print parts[-2], parts[-1] | |
break |