def test_form_lookup_key_no_epoch(self): # Setup a test rpm that doesn't have an epoch. yum assumes an epoch of 0, so we will, too test_rpm = { 'name': 'test_name', 'epoch': None, 'version': '1.0.2', 'release': '1', 'arch': 'noarch', } expected_key = ('test_name', '0', '1.0.2', '1', 'noarch') # Test self.assertEqual(expected_key, export_utils.form_lookup_key(test_rpm))
def test_form_lookup_key(self): # Setup a fake rpm and the expected return value test_rpm = { 'name': 'test_name', 'epoch': '1', 'version': '1.0.2', 'release': '1', 'arch': 'noarch', } expected_key = ('test_name', '1', '1.0.2', '1', 'noarch') # Test self.assertEqual(expected_key, export_utils.form_lookup_key(test_rpm))