本文整理汇总了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