How to use the mlblocks.discovery._load_entry_points function in mlblocks

To help you get started, we’ve selected a few mlblocks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
dist=Distribution()
    )
    another_primitives_ep = EntryPoint(
        'primitives',
        'tests.test_discovery',
        attrs=['FAKE_PRIMITIVES_PATHS'],
        dist=Distribution()
    )
    iep_mock.return_value = [
        something_else_ep,
        primitives_ep,
        another_primitives_ep
    ]

    # run
    paths = discovery._load_entry_points('primitives')

    # assert
    expected = [
        'this/is/a/fake',
        'this/is/another/fake',
        'this/is/yet/another/fake',
    ]
    assert paths == expected

    expected_calls = [
        call('mlblocks'),
    ]
    assert iep_mock.call_args_list == expected_calls
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__load_entry_points_no_entry_points(iep_mock):
    # setup
    iep_mock.return_value == []

    # run
    paths = discovery._load_entry_points('jsons_path', 'mlprimitives')

    # assert
    assert paths == []
    expected_calls = [
        call('mlprimitives'),
    ]
    assert iep_mock.call_args_list == expected_calls