def test_bundle_selected_remotes(tempdir): with patch('owmeta_core.bundle.Fetcher') as Fetcher: remotes = (object(), object()) cut = Bundle('bundle_id', version=1, bundles_directory=tempdir, remotes=remotes) cut.resolve() Fetcher().fetch.assert_called_with(ANY, 1, remotes)
def test_bundle_retrieve_remotes_default_dir(tempdir): with patch('owmeta_core.bundle.retrieve_remotes') as retrieve_remotes: remotes_dir = '/tmp/remotes_dir' cut = Bundle('bundle_id', version=1, bundles_directory=tempdir, remotes_directory=remotes_dir) try: cut.resolve() except NoRemoteAvailable: pass retrieve_remotes.assert_called_with(remotes_dir)