def test_source_as_data_expanded_partial(monkeypatch): monkeypatch.setattr("os.environ", {"USER": "******"}) s = models.Source({ "name": "devpi", "url": "https://$USER:[email protected]", "verify_ssl": False, }) assert s.url_expanded == "https://*****:*****@mydevpi.localhost"
def test_source_from_data(): s = models.Source({ "name": "devpi", "url": "https://$USER:[email protected]", "verify_ssl": False, }) assert s.name == "devpi" assert s.url == "https://$USER:[email protected]" assert s.verify_ssl is False
def test_get_slice(sources): sliced = sources[:1] assert isinstance(sliced, models.SourceCollection) assert len(sliced) == 1 assert sliced[0] == models.Source({ "name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": True, })