linode / linode_api4-python

Official Python bindings for the Linode API
https://linode-api4.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
135 stars 75 forks source link

test: Add missing integration tests to improve coverage for identified gaps #429

Closed ykim-1 closed 2 months ago

ykim-1 commented 2 months ago

📝 Description

Filling in identified test gaps found in spike - TPT-2699. Integration Tests have been added to following test suites:

For more details refer to spreadsheet attached in TPT-3010

✔️ How to Test

make TEST_SUITE="login_client" testint 
make TEST_SUITE="account" testint  
make TEST_SUITE="lke" testint  
make TEST_SUITE="longview" testint  
make TEST_SUITE="objectstorage" testint
make TEST_SUITE="profile" testint

📷 Preview

If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.

ykim-1 commented 2 months ago

test_get_current_longview_plan is failing locally for me with the following error:

test_linode_client = <linode_api4.linode_client.LinodeClient object at 0x10554cda0>

    def test_get_current_longview_plan(test_linode_client):
        lv_plan = test_linode_client.load(LongviewPlan, "")

>       assert "Longview" in lv_plan.label
E       TypeError: argument of type 'NoneType' is not iterable

test/integration/models/longview/test_longview.py:58: TypeError
=========================================================================== short test summary info ===========================================================================
FAILED test/integration/models/longview/test_longview.py::test_get_current_longview_plan - TypeError: argument of type 'NoneType' is not iterable

After I changed my Longview plan from Longview Free to Longview Pro 3 pack, it passed. Is this the intended behavior?

Good catch, looks like Longview free plan actually does not return anything and update using longview_plan_update() function is not allowed. I revised the assertion so it only checks when something is returned