linode_api4-python icon indicating copy to clipboard operation
linode_api4-python copied to clipboard

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

Open ykim-akamai opened this issue 1 year ago • 1 comments

📝 Description

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

  • Account
  • LKE
  • Longview
  • Object Storage
  • Profile

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-akamai avatar Jun 27 '24 01:06 ykim-akamai

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

ykim-akamai avatar Jun 28 '24 16:06 ykim-akamai