MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / setUpClass

Method setUpClass

tests/test_special.py:20–39  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

18
19 @classmethod
20 def setUpClass(cls):
21 try:
22 # create the database objects to test upon
23 client = create_mssql_cli_client()
24 list(client.execute_query('CREATE DATABASE {0};'.format(cls.database)))
25 list(client.execute_query('CREATE TABLE {0} (a int, b varchar(25));'
26 .format(cls.table1)))
27 list(client.execute_query('CREATE TABLE {0} (x int, y varchar(25), z bit);'
28 .format(cls.table2)))
29 list(client.execute_query('CREATE VIEW {0} as SELECT a from {1};'
30 .format(cls.view, cls.table1)))
31 list(client.execute_query('CREATE SCHEMA {0};'.format(cls.schema)))
32 list(client.execute_query('CREATE INDEX {0} ON {1} (x);'.format(cls.index, cls.table2)))
33 list(client.execute_query('CREATE FUNCTION {0}() \
34 RETURNS TABLE AS RETURN (select 1 as number);'
35 .format(cls.function)))
36 list(client.execute_query('CREATE LOGIN {0} WITH PASSWORD=\'yoloC123445!\''
37 .format(cls.login)))
38 finally:
39 shutdown(client)
40
41 @classmethod
42 def tearDownClass(cls):

Callers

nothing calls this directly

Calls 4

create_mssql_cli_clientFunction · 0.90
shutdownFunction · 0.90
execute_queryMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected