def namespace_repo(tmpdir, travis, monkeypatch): """A repository with namespace packages.""" folder = str(tmpdir.join('repo')) copy_repo('namespace_project', folder) curr_dir = os.getcwd() try: os.chdir(folder) monkeypatch.syspath_prepend(os.path.abspath(folder)) monkeypatch.setenv('GITHUB_TOKEN', "github_token") monkeypatch.setenv('PYPI_USER', 'test_user') monkeypatch.setenv('PYPI_PASS', 'test_pass') monkeypatch.setenv('SLACK_TOKEN', 'test_slack_token') monkeypatch.setenv('SLACK_WEB_HOOK', 'http://127.0.0.1:8000/nothing') multipackage_main(['init']) with open(os.path.join(".multipackage", "components.txt"), 'a') as outfile: outfile.write('\niotile_analytics_core: ./iotile_analytics_core\n') outfile.write( 'iotile_analytics_interactive: ./iotile_analytics_interactive\n' ) outfile.write( 'iotile_analytics_offline: ./iotile_analytics_offline\n') yield folder finally: os.chdir(curr_dir)
def test_update(bare_repo): """Make sure multipackage update works.""" multipackage_main(['init']) with open(os.path.join(".multipackage", "components.txt"), 'a') as outfile: outfile.write('\nmy_package: ./, compatibility=python2\n') multipackage_main(['-vvvvv', 'update'])
def bare_uni(bare_repo): """Create an initialized (but not updated) python 2/3 repository.""" multipackage_main(['init']) with open(os.path.join(".multipackage", "components.txt"), 'a') as outfile: outfile.write('\nmy_package: ./, compatibility=universal\n') return bare_repo
def test_namespace_docs(namespace_repo): """Make sure we can build documentation for namespace repos.""" multipackage_main(['update']) retval, _stdout, _stderr = run_in_sandbox([ 'python', os.path.join('.multipackage', 'scripts', 'build_documentation.py') ]) assert retval == 0
def py3_repo(bare_repo): """Create an updated python 2 repository.""" multipackage_main(['init']) with open(os.path.join(".multipackage", "components.txt"), 'a') as outfile: outfile.write('\nmy_package: ./, compatibility=python3\n') multipackage_main(['update']) return bare_repo
def test_unitialized_info(bare_repo, capsys): """Test multipackage init.""" multipackage_main(['info'])