當前位置: 首頁>>代碼示例>>Python>>正文


Python configuration.YamlRawParameter類代碼示例

本文整理匯總了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)
開發者ID:groutr,項目名稱:conda,代碼行數:31,代碼來源:test_context.py

示例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',
                            ]
開發者ID:Korijn,項目名稱:conda,代碼行數:32,代碼來源:test_channel.py

示例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)
開發者ID:groutr,項目名稱:conda,代碼行數:8,代碼來源:test_context.py

示例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
開發者ID:dhirschfeld,項目名稱:conda,代碼行數:13,代碼來源:test_channel.py

示例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)
開發者ID:jaimergp,項目名稱:conda,代碼行數:15,代碼來源:test_context.py

示例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
開發者ID:conda,項目名稱:conda,代碼行數:5,代碼來源:test_configuration.py

示例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
開發者ID:conda,項目名稱:conda,代碼行數:5,代碼來源:test_configuration.py


注:本文中的conda.common.configuration.YamlRawParameter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。