94addd5 Issue 79 - Fix replica.py and add tests

12 files Authored by spichugi 6 years ago, Committed by William Brown 6 years ago,
    Issue 79 - Fix replica.py and add tests
    
    Description: Move tests for ReplicaLegacy to replicaLegacy_test.py
    module. Add a new test suite for Replicas(DSLdapObject).
    Fix or change:
    - Add enum34 to pip and python-enum34 to specfile for RHEL7/Fedora
    - _constants.py:
      - replace REPLICAROLE_* with ReplicaRole(Enum) object
      - change the type of REPLICA_FLAGS_* from str to int
      - remove not used constants REPLICA_TYPE_* and REPLICA_FLAGS_CON
    - Agreement.create() - if property is None, define the dict object;
    - Changelog.list() - make it consistent and return empry list
      if nothing is found;
    - Replica:
      - Replace hard coded values with variables if possible;
      - Fix get_role() functions so it will return right result;
      - Fix deleteAgreements. It now doesn't have suffix param;
      - Fix typos on variables;
      - Make promote() and demote() methods more explicit;
      - Rename Replicas.delete() to Replicas.disable because
        it coveres changelog and agreements deletion too;
      - Make docstring format consistent;
    
    https://pagure.io/lib389/issue/79
    
    Reviewed by: wibrown (Thanks!)
    
        
file modified
+245 -266
file modified
+27 -26
file modified
+13 -12
file modified
+2 -1