コード例 #1
0
    def test_name_parent_flag_rename(self):
        next_step = NextStep(ancestry=['nextstep_parent'], name='nextstep')
        flag = Flag(action="Top Flag", ancestry=next_step.ancestry)
        next_step.flags = [flag]

        new_ancestry = ["nextstep_parent_update"]
        next_step.reconstruct_ancestry(new_ancestry)
        new_ancestry.append("nextstep")
        new_ancestry.append("Top Flag")
        self.assertListEqual(new_ancestry, next_step.flags[0].ancestry)
コード例 #2
0
    def test_name_parent_multiple_flag_rename(self):
        next_step = NextStep(ancestry=['nextstep_parent'], name='mod1_flag1')
        flag_one = Flag(action="Top Flag", ancestry=next_step.ancestry)
        flag_two = Flag(action="mod1_flag1", ancestry=next_step.ancestry)
        next_step.flags = [flag_one, flag_two]

        new_ancestry = ["nextstep_parent_update"]
        next_step.reconstruct_ancestry(new_ancestry)
        new_ancestry.append("mod1_flag1")
        new_ancestry.append("Top Flag")
        self.assertListEqual(new_ancestry, next_step.flags[0].ancestry)

        new_ancestry.remove("Top Flag")
        new_ancestry.append("mod1_flag1")
        self.assertListEqual(new_ancestry, next_step.flags[1].ancestry)
コード例 #3
0
 def test_name_parent_rename(self):
     next_step = NextStep(ancestry=['nextstep_parent'], name='nextstep')
     new_ancestry = ['nextstep_parent_update']
     next_step.reconstruct_ancestry(new_ancestry)
     new_ancestry.append('nextstep')
     self.assertListEqual(new_ancestry, next_step.ancestry)