kyu_7.pointless_farmer package

Submodules

kyu_7.pointless_farmer.solution module

Solution for -> Pointless Farmer.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_7.pointless_farmer.solution.buy_or_sell(pairs: list, harvested_fruit: str) str | list[source]

Decide which direction to trade.

Parameters:
  • pairs – list

  • harvested_fruit – str

Returns:

kyu_7.pointless_farmer.solution.make_deal(results: list, pair: tuple, currently_holding: str) str[source]

Return the new currently_holding value on successful deals.

Return an empty string if no deal made. :param results: list :param pair: tuple :param currently_holding: str :return: str

kyu_7.pointless_farmer.test_buy_or_sell module

Test for -> Pointless Farmer.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_7.pointless_farmer.test_buy_or_sell.PointlessFarmerTestCase(methodName='runTest')[source]

Bases: TestCase

Test ‘buy_or_sell’ function.

_classSetupFailed = False
_class_cleanups = []
test_buy_or_sell_negative = None
test_buy_or_sell_negative_0(**kw)

Testing ‘buy_or_sell’ function, negative test case [with market=[(‘orange’, ‘apple’), (‘pear’, ‘orange’), (‘apple’, ‘paer’)], harvested_fruit=’apple’, expected=’ERROR’].

Returns:

test_buy_or_sell_negative_1(**kw)

Testing ‘buy_or_sell’ function, negative test case [with market=[(‘Jackfruit’, ‘Physalis’), (‘Ph…’Prune’), (‘Prune’, ‘Tamarind’)], harvested_fruit=’Tamarind’, expected=’ERROR’].

Returns:

test_buy_or_sell_negative_2(**kw)

Testing ‘buy_or_sell’ function, negative test case [with market=[(‘Mulberry’, ‘Strawberry’), (‘P…y’), (‘Strawberry’, ‘Mulberry’)], harvested_fruit=’Strawberry’, expected=’ERROR’].

Returns:

test_buy_or_sell_negative_3(**kw)

Testing ‘buy_or_sell’ function, negative test case [with market=[(‘Cherry’, ‘Cucumber’), (‘Cherr…y’), (‘Cucumber’, ‘Ugli fruit’)], harvested_fruit=’Boysenberry’, expected=’ERROR’].

Returns:

test_buy_or_sell_negative_4(**kw)

Testing ‘buy_or_sell’ function, negative test case [with market=[(‘Jackfruit’, ‘Purple mangostee…urple mangosteen’, ‘Jackfruit’)], harvested_fruit=’Purple mangosteen’, expected=’ERROR’].

Returns:

test_buy_or_sell_positive = None
test_buy_or_sell_positive_0(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘apple’, ‘orange’), (‘orange’, ‘pear’), (‘apple’, ‘pear’)], harvested_fruit=’apple’, expected=[‘buy’, ‘buy’, ‘sell’]].

Returns:

test_buy_or_sell_positive_1(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘orange’, ‘apple’), (‘orange’, ‘pear’), (‘pear’, ‘apple’)], harvested_fruit=’apple’, expected=[‘sell’, ‘buy’, ‘buy’]].

Returns:

test_buy_or_sell_positive_2(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘apple’, ‘orange’), (‘pear’, ‘orange’), (‘apple’, ‘pear’)], harvested_fruit=’apple’, expected=[‘buy’, ‘sell’, ‘sell’]].

Returns:

test_buy_or_sell_positive_3(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘orange’, ‘apple’), (‘pear’, ‘orange’), (‘pear’, ‘apple’)], harvested_fruit=’apple’, expected=[‘sell’, ‘sell’, ‘buy’]].

Returns:

test_buy_or_sell_positive_4(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘orange’, ‘apple’), (‘orange’, ‘pear’), (‘apple’, ‘pear’)], harvested_fruit=’apple’, expected=[‘sell’, ‘buy’, ‘sell’]].

Returns:

test_buy_or_sell_positive_5(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘apple’, ‘orange’), (‘pear’, ‘orange’), (‘pear’, ‘apple’)], harvested_fruit=’apple’, expected=[‘buy’, ‘sell’, ‘buy’]].

Returns:

test_buy_or_sell_positive_6(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘apple’, ‘orange’), (‘orange’, ‘pear’), (‘pear’, ‘apple’)], harvested_fruit=’apple’, expected=[‘buy’, ‘buy’, ‘buy’]].

Returns:

test_buy_or_sell_positive_7(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘orange’, ‘apple’), (‘pear’, ‘orange’), (‘apple’, ‘pear’)], harvested_fruit=’apple’, expected=[‘sell’, ‘sell’, ‘sell’]].

Returns:

test_buy_or_sell_positive_8(**kw)

Testing ‘buy_or_sell’ function, positive test case. [with market=[(‘Raspberry’, ‘Raspberry’), (‘J…’), (‘Jabuticaba’, ‘Raspberry’)], harvested_fruit=’Raspberry’, expected=[‘sell’, ‘sell’, ‘buy’]].

Returns:

Module contents

Pointless Farmer.