Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new spec and parser for 'azure_instance_id' #3568

Merged
merged 0 commits into from
Nov 3, 2022
Merged

Conversation

xiangce
Copy link
Contributor

@xiangce xiangce commented Oct 27, 2022

  • And move the AzureInstancePlan and AzureInstancePlan to azure_instance.py
  • More the original parsers as deprecated
  • change to use the latest supported API version '2021-12-13' provided by Azure

Signed-off-by: Xiangce Liu [email protected]

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

@xiangce xiangce force-pushed the new_azure_instance branch 2 times, most recently from 88f9979 to dedfbea Compare October 27, 2022 07:56
@xiangce xiangce requested a review from psachin November 1, 2022 04:00
@psachin
Copy link
Contributor

psachin commented Nov 3, 2022

@xiangce

If we can test repr we can cover 100% core

diff --git a/insights/tests/parsers/test_azure_instance.py b/insights/tests/parsers/test_azure_instance.py
index 50ab73f53f22..05aba6900b88 100644
--- a/insights/tests/parsers/test_azure_instance.py
+++ b/insights/tests/parsers/test_azure_instance.py
@@ -73,6 +73,7 @@ def test_azure_instance_id_ab_empty():
 def test_azure_instance_id():
     azure = AzureInstanceID(context_wrap(AZURE_ID))
     assert azure.id == "f904ece8-c6c1-4b5c-881f-309b50f25e50"
+    assert repr(azure) == "<instance_id: f904ece8-c6c1-4b5c-881f-309b50f25e50>"
 
 
 # Test AzureInstanceType
@@ -113,7 +114,6 @@ def test_azure_instance_type():
     assert azure.raw == "Standard_NV48s_v3"
     assert "NV48s" in str(azure)
 
-
 def test_azure_instance_type_stats():
     azure = AzureInstanceType(context_wrap(AZURE_TYPE_3))
     assert azure.type == "Standard"
@@ -158,6 +158,7 @@ def test_azure_instance_plan():
     assert azure.product is None
     assert azure.publisher is None
     assert azure.raw == '{"name": "", "product": "", "publisher": ""}'
+    assert repr(azure) == '<azure_plan_name: None, product: None, publisher: None, raw: {"name": "", "product": "", "publisher": ""}'
 
 
 def test_doc_examples():

@psachin psachin merged commit 9975185 into master Nov 3, 2022
psachin pushed a commit that referenced this pull request Nov 3, 2022
* feat: new spec and parser for 'azure_instance_id'

- And move the AzureInstancePlan and AzureInstancePlan to
  azure_instance.py
- More the original parsers as deprecated
- change to use the latest supported API version '2021-12-13' provided by Azure

Signed-off-by: Xiangce Liu <[email protected]>

* test repr

Signed-off-by: Xiangce Liu <[email protected]>

Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit 9975185)
@xiangce xiangce deleted the new_azure_instance branch November 7, 2022 08:03
xiangce added a commit that referenced this pull request Sep 6, 2024
* feat: new spec and parser for 'azure_instance_id'

- And move the AzureInstancePlan and AzureInstancePlan to
  azure_instance.py
- More the original parsers as deprecated
- change to use the latest supported API version '2021-12-13' provided by Azure

Signed-off-by: Xiangce Liu <[email protected]>

* test repr

Signed-off-by: Xiangce Liu <[email protected]>

Signed-off-by: Xiangce Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants