Skip to content

Commit

Permalink
#506 Fix remote format
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed Jan 16, 2019
1 parent 479b0dc commit 1d7320e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bincrafters/build_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get_conan_upload(username):
def get_conan_remotes(username):
remotes = os.getenv("CONAN_REMOTES")
if remotes:
return remotes.split('@') if '@' in remotes else remotes
return [remotes.split('@')] if '@' in remotes else [remotes]

# While redundant, this moves upload remote to position 0.
remotes = [get_conan_upload(username)]
Expand Down
15 changes: 15 additions & 0 deletions tests/test_package_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ def set_upload_address():
del os.environ["CONAN_UPLOAD"]


@pytest.fixture()
def set_remote_address():
os.environ["CONAN_REMOTES"] = "https://api.bintray.com/conan/foo/bar@False@remotefoo"
yield
del os.environ["CONAN_REMOTES"]


def test_build_template_boost_default():
builder = build_template_boost_default.get_builder()

Expand Down Expand Up @@ -176,3 +183,11 @@ def test_format_upload(set_upload_address):
assert "remotefoo" == builder.remotes_manager._upload.name
assert "https://api.bintray.com/conan/foo/bar" == builder.remotes_manager._upload.url
assert 'False' == builder.remotes_manager._upload.use_ssl


def test_format_remote(set_remote_address):
builder = build_template_default.get_builder()
remote = builder.remotes_manager._remotes[0]
assert "remotefoo" == remote.name
assert "https://api.bintray.com/conan/foo/bar" == remote.url
assert 'False' == remote.use_ssl

0 comments on commit 1d7320e

Please sign in to comment.