def test_generate_data(self): """Test that the VPC generate_data method works.""" generator = VPCGenerator(self.two_hours_ago, self.now, self.payer_account, self.usage_accounts, self.attributes) data = generator.generate_data() self.assertNotEqual(data, [])
def test_update_data(self): """Test VPC specific update data method.""" generator = VPCGenerator(self.two_hours_ago, self.now) start_row = {} row = generator._update_data(start_row, self.two_hours_ago, self.now, **{"config": generator.config[0]}) self.assertEqual(row["product/servicecode"], "AmazonVPC") self.assertEqual(row["lineItem/Operation"], "CreateVpnConnection") self.assertEqual(row["lineItem/ProductCode"], "AmazonVPC")
def test_update_data(self): """Test VPC specific update data method.""" generator = VPCGenerator(self.two_hours_ago, self.now, self.payer_account, self.usage_accounts, self.attributes) start_row = {} row = generator._update_data(start_row, self.two_hours_ago, self.now) self.assertEqual(row["product/servicecode"], "AmazonVPC") self.assertEqual(row["lineItem/Operation"], "CreateVpnConnection") self.assertEqual(row["lineItem/ProductCode"], "AmazonVPC")
def test_init_with_attributes(self): """Test the unique init options for Data Transfer.""" generator = VPCGenerator(self.two_hours_ago, self.now, self.payer_account, self.usage_accounts, self.attributes) self.assertEqual(generator._product_sku, self.product_sku) self.assertEqual(generator._tags, self.tags) self.assertEqual(generator._resource_id, "vpn-" + self.resource_id)
def test_init_with_attributes(self): """Test the unique init options for Data Transfer.""" test_args = self.test_config_kwargs test_args["generator"] = "VPCGenerator" test_config = create_test_config(**test_args) generator = VPCGenerator(self.two_hours_ago, self.now, user_config=test_config) self.assertEqual(generator.config[0].get("product_sku"), self.product_sku) self.assertIn(self.tags["key"], generator.config[0].get("tags").keys()) self.assertEqual(generator.config[0].get("resource_id"), self.resource_id) os.remove(test_config)
def test_generate_data(self): """Test that the VPC generate_data method works.""" generator = VPCGenerator(self.two_hours_ago, self.now) data = generator.generate_data() self.assertNotEqual(data, [])