mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
Modify for codacy again
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
0b84ec84d9
commit
e6f5f62c53
@ -75,7 +75,7 @@ class Replication(base.Base):
|
||||
time.sleep(interval)
|
||||
if not finished:
|
||||
raise Exception("The jobs not finished")
|
||||
|
||||
|
||||
def delete_replication_rule(self, rule_id, expect_status_code = 200, **kwargs):
|
||||
client = self._get_client(**kwargs)
|
||||
_, status_code, _ = client.policies_replication_id_delete_with_http_info(rule_id)
|
||||
|
@ -84,15 +84,15 @@ class TestProjects(unittest.TestCase):
|
||||
TestProjects.rule_id_list = []
|
||||
|
||||
trigger_values_to_set = ["Manual", "Immediate"]
|
||||
for i in range(len(trigger_values_to_set)):
|
||||
for value in trigger_values_to_set:
|
||||
#4. Create a new rule for project(PA) and target(TA)
|
||||
rule_id, rule_name = self.replication.create_replication_rule([TestProjects.project_add_rule_id],
|
||||
[TestProjects.target_id], trigger=swagger_client.RepTrigger(kind=trigger_values_to_set[i]), **TestProjects.ADMIN_CLIENT)
|
||||
[TestProjects.target_id], trigger=swagger_client.RepTrigger(kind=value), **TestProjects.ADMIN_CLIENT)
|
||||
TestProjects.rule_id_list.append(rule_id)
|
||||
|
||||
#5. Check rule should be exist
|
||||
self.replication.check_replication_rule_should_exist(rule_id, rule_name, expect_trigger = trigger_values_to_set[i], **TestProjects.ADMIN_CLIENT)
|
||||
|
||||
self.replication.check_replication_rule_should_exist(rule_id, rule_name, expect_trigger = value, **TestProjects.ADMIN_CLIENT)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user