def test_kms_activate(self): test_data = { 'activation_key': 'activation_key', 'profile': 'kms_profile', 'domains': 'iadproxy.rhn.rackspace.com' } kms.UP2DATE_PATH = '/tmp/up2date' with mock.patch('novaagent.common.kms.register_with_rhn') as reg: reg.return_value = None success = kms.kms_activate(test_data) self.assertEqual( success, ("0", ""), 'Return value was not expected value' ) files = glob.glob('/tmp/up2date*') self.assertEqual( len(files), 1, 'Did not find written file' ) with open('/tmp/up2date') as f: written_data = f.readlines() for index, line in enumerate(written_data): self.assertEqual( line, kms_data.UP2DATE_READLINES[index], 'Written file did not match expected value' )
def kmsactivate(self, name, value, client): return kms.kms_activate(value)
def kmsactivate(self, name, value): return kms.kms_activate(value)