def test_hunts_white_walkers_but_not_if_protecting_starks(self):
        wolf = Direwolf('Nymeria', "Winterfell")
        stark = Stark('Sansa')

        wolf.protects(stark)

        wolf.hunts_white_walkers()
    def test_can_only_protect_stark_kids_if_home_and_location_match(self):
        wolf = Direwolf('Ghost')
        stark = Stark('John', "King's Landing")

        wolf.protects(stark)

        assert wolf.starks_to_protect, []
        assert wolf.home, 'Beyond the Wall'
    def test_protects_stark_kids(self):
        wolf = Direwolf('Nymeria', 'Riverlands')
        stark = Stark('Arya', 'Riverlands')

        wolf.protects(stark)

        assert wolf.starks_to_protect[0], 'Arya'
        assert stark.location, 'Riverlands'
        assert wolf.home, 'Riverlands'
    def test_protected_status_changes_once_protected(self):
        wolf = Direwolf('Nymeria', "Winterfell")
        arya_stark = Stark('Arya')
        sansa_stark = Stark('Sansa')

        wolf.protects(arya_stark)

        assert arya_stark.safe, True
        assert arya_stark.house_words, 'The North Remembers'
        assert sansa_stark.house_words, 'Winter is Coming'
    def test_wolves_can_leave_and_stop_protecting_starks(self):
        summer_wolf = Direwolf('Summer', "Winterfell")
        lady_wolf = Direwolf('Lady', "Winterfell")
        sansa_stark = Stark('Sansa')
        arya_stark = Stark('Arya')

        summer_wolf.protects(arya_stark)
        lady_wolf.protects(sansa_stark)
        summer_wolf.leaves(arya_stark)

        assert summer_wolf.starks_to_protect, []
        assert lady_wolf.starks_to_protect, [sansa_stark]
        assert not arya_stark.safe, True
    def test_direwolf_can_only_protect_two_starks_at_a_time(self):
        summer_wolf = Direwolf('Summer', "Winterfell")
        lady_wolf = Direwolf('Lady', "Winterfell")
        sansa_stark = Stark('Sansa')
        john_stark = Stark('John')
        rob_stark = Stark('Rob')
        bran_stark = Stark('Bran')
        arya_stark = Stark('Arya')

        summer_wolf.protects(sansa_stark)
        summer_wolf.protects(john_stark)
        lady_wolf.protects(rob_stark)
        lady_wolf.protects(bran_stark)
        lady_wolf.protects(arya_stark)

        summer_num = len(summer_wolf.starks_to_protect)
        lady_num = len(lady_wolf.starks_to_protect)
        assert summer_num, 2
        assert lady_num, 2
    def test_if_stark_not_protected_when_direwolf_leaves_then_that_stark_is_the_return_value(
            self):
        summer_wolf = Direwolf('Summer', "Winterfell")
        lady_wolf = Direwolf('Lady', "Winterfell")
        sansa_stark = Stark('Sansa')
        arya_stark = Stark('Arya')
        rickon_stark = Stark('Rickon')

        summer_wolf.protects(arya_stark)
        lady_wolf.protects(sansa_stark)
        lady_wolf.protects(rickon_stark)
        summer_wolf.leaves(arya_stark)
        lady_wolf.leaves(rickon_stark)

        assert not arya_stark.safe, True
        assert summer_wolf.leaves(arya_stark), "Arya"