def METHOD_NAME(self):
    rule = TradingRule((ewmac_forecast_with_defaults, [], {}))
    assert rule.function == ewmac_forecast_with_defaults
    rule2 = TradingRule(rule)
    assert (rule.function, rule.data, rule.other_args) == (
        rule2.function,
        rule2.data,
        rule2.other_args,
    )
    rule3 = TradingRule(
        ewmac_forecast_with_defaults,
        ["data.get_instrument_price"],
        dict(Lfast=50, Lslow=200),
    )
    assert rule3.data == ["data.get_instrument_price"]
    rule4 = TradingRule(
        ewmac_forecast_with_defaults,
        "data.get_instrument_price",
        dict(Lfast=50, Lslow=200),
    )
    assert rule4.data == ["data.get_instrument_price"]
    try:
        rule4 = TradingRule(
            ewmac_forecast_with_defaults, "data.get_instrument_price"
        )
        rule5 = TradingRule((ewmac_forecast_with_defaults,))
        raise Exception("Should have failed with 2 tuple")
    except BaseException:
        pass
    rule7 = TradingRule(
        "systems.provided.rules.ewmac.ewmac_forecast_with_defaults",
        [],
        dict(Lfast=50, Lslow=200),
    )
    assert rule7.function == rule.function
    try:
        rule8 = TradingRule(
            "not.a.real.rule.just.a.string.of.arbitrary.text",
            [],
            dict(Lfast=50, Lslow=200),
        )
        raise Exception("Should have failed with non existent rule")
    except BaseException:
        pass
    rule9 = TradingRule(dict(function=ewmac_forecast_with_defaults))
    try:
        rule10 = TradingRule(dict(functionette=ewmac_forecast_with_defaults))
        raise Exception("Should have failed with no function keyword")
    except BaseException:
        pass
    rule11 = TradingRule(
        dict(
            function="systems.provided.rules.ewmac.ewmac_forecast_with_defaults",
            other_args=dict(Lfast=50),
            data=[],
        )
    )
    rule12 = TradingRule(ewmac_forecast_with_defaults, other_args=dict(Lfast=30))
    rule13 = TradingRule(
        "systems.provided.rules.ewmac.ewmac_forecast_with_defaults",
        data="data.get_pricedata",
    )
    assert rule13.data == ["data.get_pricedata"]
    rule14 = TradingRule(ewmac_forecast_with_defaults)
    try:
        rule15 = TradingRule(set())
        raise Exception("Should have failed with other data type")
    except BaseException:
        pass