Beispiel #1
0
 def test_state_present(self):
     current_cgs = {}
     session = FakeKojiSession()
     result = koji_cg.ensure_cg(session, 'rcm/debbuild', 'debian',
                                'present', current_cgs, False)
     assert result['changed'] is True
     # Verify the new CG that we added.
     assert session.cgs == {'debian': {'users': ['rcm/debbuild']}}
Beispiel #2
0
 def test_state_absent_unchanged(self):
     current_cgs = {}
     session = FakeKojiSession()
     result = koji_cg.ensure_cg(session, 'rcm/debbuild', 'debian', 'absent',
                                current_cgs, False)
     assert result['changed'] is False
     # Verify the new CGs match the old ones.
     assert session.cgs == current_cgs
Beispiel #3
0
 def test_state_absent(self):
     current_cgs = {'debian': {'users': ['rcm/debbuild']}}
     session = FakeKojiSession()
     session.cgs = current_cgs.copy()
     result = koji_cg.ensure_cg(session, 'rcm/debbuild', 'debian', 'absent',
                                current_cgs, False)
     assert result['changed'] is True
     # Verify that the CG we deleted is gone.
     assert session.cgs == {}