Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoodfred committed Apr 29, 2024
1 parent 38a9d34 commit 63422da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nise/generators/azure/azure_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _get_location(self):
location = choice(self.RESOURCE_LOCATION)
return location

def _get_additional_info(self, meter_name):
def _get_additional_info(self, meter_name=None):
"""Pick additional info."""
if self._additional_info:
return self._additional_info
Expand Down
8 changes: 3 additions & 5 deletions tests/test_azure_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,14 @@ def test_init_with_attributes(self):
self.assertEqual(generator._usage_quantity, self.usage_quantity)
self.assertEqual(generator._resource_rate, self.resource_rate)
self.assertEqual(generator._pre_tax_cost, self.pre_tax_cost)
self.assertTrue(set(generator._additional_info.keys()).issubset(self.ADDITIONAL_INFO_KEYS))

def test_update_data(self):
"""Test that row is updated."""
generator = DTGenerator(self.two_hours_ago, self.now, self.currency, self.account_info)
start_row = {}
row = generator._update_data(start_row, self.two_hours_ago, self.now)
self.assertEqual(row["ConsumedService"], "microsoft.compute")
self.assertEqual(row["ResourceType"], "Microsoft.Network/publicIPAddresses")
self.assertEqual(row["ResourceType"], "microsoft.compute/publicIPAddresses")

def test_update_data_with_attributes(self):
"""Test that row is updated."""
Expand All @@ -487,14 +486,14 @@ def test_update_data_with_attributes(self):
self.now,
self.currency,
self.account_info,
self.attributes | {"data_direction": "in"},
self.attributes.update({"data_direction": "in"}),
),
VNGenerator(
self.two_hours_ago,
self.now,
self.currency,
self.account_info,
self.attributes_v2 | {"data_direction": "in"},
self.attributes_v2.update({"data_direction": "in"}),
),
]
for generator in default_generators:
Expand All @@ -511,4 +510,3 @@ def test_update_data_with_attributes(self):
self.assertEqual(row["ResourceId"], self.instance_id)
self.assertEqual(row["MeterSubCategory"], "Virtual Network Private Link")
self.assertEqual(row["MeterName"], "Standard Data Processed - Ingress")
print(row["MeterName"])

0 comments on commit 63422da

Please sign in to comment.