2020-01-29 22:39:52 +01:00
|
|
|
Author: Sean Marlow <sean.marlow@suse.com>
|
|
|
|
Date: 2019-12-11
|
|
|
|
Source: https://github.com/oracle/oci-python-sdk/issues/196
|
|
|
|
|
2020-02-07 13:37:53 +01:00
|
|
|
diff -Nru oci-python-sdk-2.10.3.orig/tests/unit/test_basic_api_calls.py oci-python-sdk-2.10.3/tests/unit/test_basic_api_calls.py
|
|
|
|
--- oci-python-sdk-2.10.3.orig/tests/unit/test_basic_api_calls.py 2020-02-04 22:53:15.000000000 +0100
|
|
|
|
+++ oci-python-sdk-2.10.3/tests/unit/test_basic_api_calls.py 2020-02-07 12:48:24.663500407 +0100
|
|
|
|
@@ -4,7 +4,7 @@
|
|
|
|
import oci
|
2020-01-29 22:39:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
-def test_identity_list_users(identity, config):
|
|
|
|
+def test_identity_list_users(config, identity):
|
|
|
|
response = identity.list_users(config["tenancy"])
|
|
|
|
|
|
|
|
assert response is not None
|
2020-02-07 13:37:53 +01:00
|
|
|
@@ -30,7 +30,7 @@
|
2020-01-29 22:39:52 +01:00
|
|
|
assert response.request_id is not None
|
|
|
|
|
|
|
|
|
|
|
|
-def test_limit(identity, config):
|
|
|
|
+def test_limit(config, identity):
|
|
|
|
response = identity.list_users(config["tenancy"], limit=1)
|
|
|
|
|
|
|
|
assert response is not None
|
2020-02-07 13:37:53 +01:00
|
|
|
diff -Nru oci-python-sdk-2.10.3.orig/tests/unit/test_basic_api_calls.py.orig oci-python-sdk-2.10.3/tests/unit/test_basic_api_calls.py.orig
|
|
|
|
--- oci-python-sdk-2.10.3.orig/tests/unit/test_basic_api_calls.py.orig 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
+++ oci-python-sdk-2.10.3/tests/unit/test_basic_api_calls.py.orig 2020-02-04 22:53:15.000000000 +0100
|
|
|
|
@@ -0,0 +1,40 @@
|
|
|
|
+# coding: utf-8
|
|
|
|
+# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
+
|
|
|
|
+import oci
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def test_identity_list_users(identity, config):
|
|
|
|
+ response = identity.list_users(config["tenancy"])
|
|
|
|
+
|
|
|
|
+ assert response is not None
|
|
|
|
+ assert len(response.data) > 0
|
|
|
|
+ assert type(response.data[0]) is oci.identity.models.User
|
|
|
|
+ assert response.status == 200
|
|
|
|
+ assert response.request_id is not None
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def test_vcn_list_vcns(virtual_network, config):
|
|
|
|
+ response = virtual_network.list_vcns(config["tenancy"])
|
|
|
|
+
|
|
|
|
+ assert response is not None
|
|
|
|
+ assert response.status == 200
|
|
|
|
+ assert response.request_id is not None
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def test_vcn_list_instances(compute, config):
|
|
|
|
+ response = compute.list_instances(config["tenancy"])
|
|
|
|
+
|
|
|
|
+ assert response is not None
|
|
|
|
+ assert response.status == 200
|
|
|
|
+ assert response.request_id is not None
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def test_limit(identity, config):
|
|
|
|
+ response = identity.list_users(config["tenancy"], limit=1)
|
|
|
|
+
|
|
|
|
+ assert response is not None
|
|
|
|
+ assert len(response.data) == 1
|
|
|
|
+ assert type(response.data[0]) is oci.identity.models.User
|
|
|
|
+ assert response.status == 200
|
|
|
|
+ assert response.request_id is not None
|
|
|
|
diff -Nru oci-python-sdk-2.10.3.orig/tests/unit/test_waiters.py oci-python-sdk-2.10.3/tests/unit/test_waiters.py
|
|
|
|
--- oci-python-sdk-2.10.3.orig/tests/unit/test_waiters.py 2020-02-04 22:53:15.000000000 +0100
|
|
|
|
+++ oci-python-sdk-2.10.3/tests/unit/test_waiters.py 2020-02-07 12:48:24.663500407 +0100
|
|
|
|
@@ -108,7 +108,7 @@
|
2020-01-29 22:39:52 +01:00
|
|
|
assert total_time < 60 * 5
|
|
|
|
|
|
|
|
|
|
|
|
-def test_invalid_operation(identity, config):
|
|
|
|
+def test_invalid_operation(config, identity):
|
|
|
|
# Create User
|
|
|
|
request = oci.identity.models.CreateUserDetails()
|
|
|
|
request.compartment_id = config["tenancy"]
|
2020-02-07 13:37:53 +01:00
|
|
|
@@ -131,7 +131,7 @@
|
2020-01-29 22:39:52 +01:00
|
|
|
oci.wait_until(identity, response, 'not a real property', 'test')
|
|
|
|
|
|
|
|
|
|
|
|
-def test_already_in_state(identity, config):
|
|
|
|
+def test_already_in_state(config, identity):
|
|
|
|
description = 'test user'
|
|
|
|
request = oci.identity.models.CreateUserDetails()
|
|
|
|
request.compartment_id = config["tenancy"]
|
2020-02-07 13:37:53 +01:00
|
|
|
@@ -151,7 +151,7 @@
|
2020-01-29 22:39:52 +01:00
|
|
|
identity.delete_user(user_id)
|
|
|
|
|
|
|
|
|
|
|
|
-def test_wait_time_exceeded(identity, config):
|
|
|
|
+def test_wait_time_exceeded(config, identity):
|
|
|
|
description = 'test user'
|
|
|
|
request = oci.identity.models.CreateUserDetails()
|
|
|
|
request.compartment_id = config["tenancy"]
|
2020-02-07 13:37:53 +01:00
|
|
|
@@ -182,7 +182,7 @@
|
2020-01-29 22:39:52 +01:00
|
|
|
assert str(ve.value) == 'If an evaluate_response function is provided, then the property argument cannot also be provided'
|
|
|
|
|
|
|
|
|
|
|
|
-def test_eval_function_lambda(identity, config):
|
|
|
|
+def test_eval_function_lambda(config, identity):
|
|
|
|
user_id = None
|
|
|
|
try:
|
|
|
|
description = 'test user'
|
2020-02-07 13:37:53 +01:00
|
|
|
@@ -206,7 +206,7 @@
|
2020-01-29 22:39:52 +01:00
|
|
|
identity.delete_user(user_id)
|
|
|
|
|
|
|
|
|
|
|
|
-def test_eval_function_func_ref(identity, config):
|
|
|
|
+def test_eval_function_func_ref(config, identity):
|
|
|
|
user_id = None
|
|
|
|
try:
|
|
|
|
description = 'test user'
|