def test_remote_generate_uploaders_skip(): mock = Mock() with patch('owmeta_core.bundle.UPLOADER_CLASSES', [mock]): r0 = Remote('remote') r0.add_config(URLConfig('http://example.org/bundle_remote0')) for ul in r0.generate_uploaders(): pass mock.can_upload_to.assert_called()
def test_write_read_remote_2(): out = StringIO() r0 = Remote('remote') r0.add_config(URLConfig('http://example.org/bundle_remote0')) r0.add_config(URLConfig('http://example.org/bundle_remote1')) r0.write(out) out.seek(0) r1 = Remote.read(out) assert r0 == r1
def test_get_http_url_loaders(): ''' Find loaders for HTTP URLs ''' load_entry_point_loaders() r0 = Remote('remote') r0.add_config(URLConfig('http://example.org/bundle_remote0')) for l in r0.generate_loaders(): if isinstance(l, HTTPBundleLoader): return raise AssertionError('No HTTPBundleLoader was created')
def test_remote_add_config_no_dupe(): uc = URLConfig('http://example.org/bluh') cut = Remote('test', (uc, )) cut.add_config(uc) assert len(cut.accessor_configs) == 1