def make_item_expected(item_id=None, region=None, endpoint=None):
    if endpoint is None:
        endpoint = 'asdf'
    old_item = make_old_item(item_id=item_id, region=region)
    sku, version = parse_id(old_item.data['id'])
    full_spec = (CANONICAL, UBUNTU_SERVER, sku, version)
    urn = ':'.join(full_spec)
    arm_region = old_item.data['region'].lower().replace(' ', '')
    expected_item = convert_item_to_arm(old_item, urn, endpoint, arm_region)
    return old_item, full_spec, expected_item
 def test_no_patchlevel_not_lts(self):
     sku, version = parse_id(make_id(patch='', lts=False))
     self.assertEqual('12.04', sku)
     self.assertEqual('12.04.201409244', version)
 def test_no_patchlevel(self):
     sku, version = parse_id(make_id(patch=''))
     self.assertEqual('12.04.0-LTS', sku)
     self.assertEqual('12.04.201409244', version)
 def test_parse_id(self):
     sku, version = parse_id(make_id())
     self.assertEqual('12.04.5-LTS', sku)
     self.assertEqual('12.04.201409244', version)
 def test_no_build_number(self):
     sku, version = parse_id(make_id(build_number=''))
     self.assertEqual('12.04.5-LTS', sku)
     self.assertEqual('12.04.201409240', version)
 def test_beta_not_lts(self):
     sku, version = parse_id(make_id(beta=True, lts=False))
     self.assertEqual('12.04.5', sku)
     self.assertEqual('12.04.201409244', version)
 def test_beta_no_patch(self):
     sku, version = parse_id(make_id(patch='', beta=True))
     self.assertEqual('12.04-beta', sku)
     self.assertEqual('12.04.201409244', version)
 def test_beta(self):
     sku, version = parse_id(make_id(beta=True))
     self.assertEqual('12.04.5-beta', sku)
     self.assertEqual('12.04.201409244', version)