Skip to content

Commit

Permalink
Test for AK update
Browse files Browse the repository at this point in the history
  • Loading branch information
lhellebr committed Sep 7, 2023
1 parent e0d1863 commit 9956588
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,26 @@ def test_remove(self):
self.assertEqual(handlr.call_count, 1)


class ActivationKeyTestCase(TestCase):
"""Tests for :class:`nailgun.entities.ActivationKey`."""

def test_creation_and_update(self):
"""Check template combinations as json or entity is set on correct
attribute template_combinations_attributes ( check #333)
"""
cfg = config.ServerConfig(url='foo')
activation_key = entities.ActivationKey(cfg, name='test_ak', organization=42)
expected_dct = {
'name': 'test_ak',
'organization_id': 42,
}
self.assertEqual(expected_dct, activation_key.create_payload())
# Testing update
activation_key.name = 'test_ak_new'
expected_dct['name'] = 'test_ak_new'
self.assertEqual(expected_dct, activation_key.update_payload())


class ReportTemplateTestCase(TestCase):
"""Tests for :class:`nailgun.entities.ReportTemplate`."""

Expand Down

0 comments on commit 9956588

Please sign in to comment.