def test_build_is_removed_when_removing_by_build(self): blds = self.get_builds() bol = BuildOrderLibrary(blds) bol.remove_build_by_build_order(blds[1]) self.assertEqual(2, bol.build_count()) self.assertIsNone(bol.get_build_by_name("my_second"))
def test_first_build_with_given_name_is_returned_when_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) bo = bol.get_build_by_name("my_second") self.assertEqual("second", bo.build[0].name)
def test_build_is_removed_when_removing_by_index(self): bol = BuildOrderLibrary(self.get_builds()) bol.remove_build_by_index(1) self.assertIsNone(bol.get_build_by_name("my_second"))
def test_none_is_returned_when_build_with_name_does_not_exist(self): bol = BuildOrderLibrary(self.get_builds()) bo = bol.get_build_by_name("gggg") self.assertIsNone(bo)
def test_correct_build_is_returned_when_given_name(self): bol = BuildOrderLibrary(self.get_builds()) bo = bol.get_build_by_name("my_second") self.assertEqual("my_second", bo.name)