예제 #1
0
def test_update_factory_non_existent(hook: AzureDataFactoryHook, user_args,
                                     sdk_args):
    hook._factory_exists = Mock(return_value=False)

    with pytest.raises(AirflowException, match=r"Factory .+ does not exist"):
        hook.update_factory(*user_args)
예제 #2
0
def test_update_factory(hook: AzureDataFactoryHook, user_args, sdk_args):
    hook._factory_exists = Mock(return_value=True)
    hook.update_factory(*user_args)

    hook._conn.factories.create_or_update.assert_called_with(*sdk_args)