def test_write_read_remote_1(): out = StringIO() r0 = Remote('remote') r0.write(out) out.seek(0) r1 = Remote.read(out) assert r0 == r1
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_remote_bundle(pytester): # Set up a remote remote = Remote( 'test', (FileURLConfig(f'file://{pytester.path}/remote-bundles'), )) sio = StringIO() remote.write(sio) pytester.makefile('.remote', test=sio.getvalue()) # Set up the test that will be run pytester.copy_example('bundle_remote_test.py') # Copy the bundle(s) we use in the test shutil.copytree(Path(CWD, 'bundles'), Path(pytester.path, 'remote-bundles')) # Run the test, asserting that one test passes and none fail (implicit) pytester.runpytest().assert_outcomes(passed=1)