Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,215 changes: 541 additions & 674 deletions examples/test_vpc_v1_examples.py

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions ibm_vpc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,23 @@
HEADER_NAME_USER_AGENT = 'User-Agent'
SDK_NAME = 'vpc-python-sdk'


def get_system_info():
"""
Get information about the system to be inserted into the User-Agent header.
"""
return 'lang={0}; arch={1}; os={2}; python.version={3}'.format('python',
platform.machine(), # Architecture
platform.system(), # OS
platform.python_version()) # Python version
return 'lang={0}; arch={1}; os={2}; python.version={3}'.format(
'python', platform.machine(), platform.system(), platform.python_version() # Architecture # OS
) # Python version


def get_x_request_id():
"""
Get the value to be sent in the X-Request-Id header.
"""
return str(uuid.uuid4())


def get_user_agent():
"""
Get the value to be sent in the User-Agent header.
Expand Down
1 change: 1 addition & 0 deletions ibm_vpc/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""
Version of vpc
"""

__version__ = '0.25.0'
8,698 changes: 6,098 additions & 2,600 deletions ibm_vpc/vpc_v1.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ibm-vpc"
version = "0.0.1"
version = "0.25.0"
authors = [
{ name="IBM", email="devxsdk@us.ibm.com" }
]
Expand Down
9 changes: 5 additions & 4 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,32 @@
# Read config file
configFile = 'vpc.env'


def loadConfigFile():
if os.path.exists(configFile):
os.environ['IBM_CREDENTIALS_FILE'] = configFile
else:
pytest.skip('External configuration not available, skipping...')


@pytest.fixture(scope="session")
def createGen2Service():
loadConfigFile()
service = VpcV1.new_instance()
headers = {
'Accept': 'application/json'
}
headers = {'Accept': 'application/json'}
service.set_default_headers(headers)
print('Setup complete.')
return service


def pytest_addoption(parser):
parser.addoption("--env", action="store", help="Run test on dev environment")


@pytest.fixture()
def env(request):
val = request.config.getoption("--env")
if val == 'true':
print('Test on dev env -', val)
return True
return False

Loading