def test_first_build_is_removed_when_removing_by_name_and_multiple_builds_have_the_same_name( self): blds = self.get_builds() blds[1].build.append(BuildOrderElement(1, "second", 0, 0, 0)) blds[2].build.append(BuildOrderElement(1, "third", 0, 0, 0)) blds[2].name = "my_second" bol = BuildOrderLibrary(blds) bol.remove_build_by_name("my_second") self.assertEqual("third", bol.get_build_by_name("my_second").build[0].name)
def test_no_builds_are_removed_if_invalid_name_is_given(self): bol = BuildOrderLibrary(self.get_builds()) bol.remove_build_by_name("gggg") self.assertEqual(3, bol.build_count())
def test_build_is_removed_when_removing_by_name(self): bol = BuildOrderLibrary(self.get_builds()) bol.remove_build_by_name("my_second") self.assertIsNone(bol.get_build_by_name("my_second"))