本文整理匯總了Python中conda.common.configuration.YamlRawParameter類的典型用法代碼示例。如果您正苦於以下問題:Python YamlRawParameter類的具體用法?Python YamlRawParameter怎麽用?Python YamlRawParameter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了YamlRawParameter類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
def setUp(self):
string = dals("""
custom_channels:
darwin: https://some.url.somewhere/stuff
chuck: http://another.url:8080/with/path
custom_multichannels:
michele:
- https://do.it.with/passion
- learn_from_every_thing
steve:
- more-downloads
migrated_custom_channels:
darwin: s3://just/cant
chuck: file:///var/lib/repo/
migrated_channel_aliases:
- https://conda.anaconda.org
channel_alias: ftp://new.url:8082
conda-build:
root-dir: /some/test/path
proxy_servers:
http: http://user:[email protected]:8080
https: none
ftp:
sftp: ''
ftps: false
rsync: 'false'
aggressive_update_packages: []
""")
reset_context()
rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
context._set_raw_data(rd)
示例2: setUpClass
def setUpClass(cls):
string = dals("""
custom_channels:
darwin: https://some.url.somewhere/stuff
chuck: http://user1:[email protected]:8080/t/tk-1234/with/path
pkgs/free: http://192.168.0.15:8080
migrated_custom_channels:
darwin: s3://just/cant
chuck: file:///var/lib/repo/
pkgs/free: https://repo.continuum.io
migrated_channel_aliases:
- https://conda.anaconda.org
channel_alias: ftp://new.url:8082
default_channels:
- http://192.168.0.15:8080/pkgs/free
- http://192.168.0.15:8080/pkgs/pro
- http://192.168.0.15:8080/pkgs/msys2
""")
reset_context()
rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
context._add_raw_data(rd)
Channel._reset_state()
cls.platform = context.subdir
cls.DEFAULT_URLS = ['http://192.168.0.15:8080/pkgs/free/%s' % cls.platform,
'http://192.168.0.15:8080/pkgs/free/noarch',
'http://192.168.0.15:8080/pkgs/pro/%s' % cls.platform,
'http://192.168.0.15:8080/pkgs/pro/noarch',
'http://192.168.0.15:8080/pkgs/msys2/%s' % cls.platform,
'http://192.168.0.15:8080/pkgs/msys2/noarch',
]
示例3: test_client_ssl_cert
def test_client_ssl_cert(self):
string = dals("""
client_ssl_cert_key: /some/key/path
""")
reset_context()
rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
context._set_raw_data(rd)
pytest.raises(ValidationError, context.validate_configuration)
示例4: setUpClass
def setUpClass(cls):
string = dals("""
default_channels:
- http://test/conda/anaconda
channels:
- http://test/conda/anaconda-cluster
""")
reset_context()
rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
context._set_raw_data(rd)
Channel._reset_state()
cls.platform = context.subdir
示例5: setUp
def setUp(self):
string = dals("""
custom_channels:
darwin: https://some.url.somewhere/stuff
chuck: http://another.url:8080/with/path
migrated_custom_channels:
darwin: s3://just/cant
chuck: file:///var/lib/repo/
migrated_channel_aliases:
- https://conda.anaconda.org
channel_alias: ftp://new.url:8082
""")
reset_context()
rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
context._add_raw_data(rd)
示例6: test_invalid_seq_parameter
def test_invalid_seq_parameter(self):
data = odict(s1=YamlRawParameter.make_raw_parameters('s1', {'channels': 'y_u_no_tuple'}))
config = SampleConfiguration()._set_raw_data(data)
with raises(InvalidTypeError):
config.channels
示例7: test_invalid_map_parameter
def test_invalid_map_parameter(self):
data = odict(s1=YamlRawParameter.make_raw_parameters('s1', {'proxy_servers': 'blah'}))
config = SampleConfiguration()._set_raw_data(data)
with raises(InvalidTypeError):
config.proxy_servers