コード例 #1
0
ファイル: test_jcds.py プロジェクト: rorymurdock/python-jss
 def test_jcds_scrape_info(self, cloud_j):  # type: (JSS) -> None
     """Test that the JCDS distribution server object can scrape all needed information from the jamfcloud packages
     page."""
     jcds = JCDS(jss=cloud_j)
     jcds._scrape_tokens()
     assert 'jcds_base_url' in jcds.connection
     print(jcds.connection['jcds_base_url'])
     assert 'jcds_upload_token' in jcds.connection
     print(jcds.connection['jcds_upload_token'])
コード例 #2
0
ファイル: test_jcds.py プロジェクト: rorymurdock/python-jss
    def test_jcds_create_and_upload(self, cloud_j,
                                    pkg_path):  # type: (JSS) -> None
        """Assert that we can create a package object, then upload an associated package via JCDS."""
        jcds = JCDS(jss=cloud_j)
        jcds._scrape_tokens()
        assert 'jcds_base_url' in jcds.connection
        print(jcds.connection['jcds_base_url'])
        assert 'jcds_upload_token' in jcds.connection
        print(jcds.connection['jcds_upload_token'])
        jcds.copy_pkg(pkg_path)

        pkg = jss.Package(cloud_j, os.path.basename(pkg_path))
        pkg.save()
コード例 #3
0
ファイル: test_jcds.py プロジェクト: rorymurdock/python-jss
    def test_jcds_upload_chunks(self, cloud_j,
                                pkg_path):  # type: (JSS) -> None
        """Assert that we can POST a chunked file as multipart form data, with form field name = ``file`` and filename
        = ``blob`. eg.

        POST https://regioncode-jcds.jamfcloud.com//api/file/v1/<tenant code>/package.pkg/part?chunk=0&chunks=12
        """
        jcds = JCDS(jss=cloud_j)
        jcds._scrape_tokens()
        assert 'jcds_base_url' in jcds.connection
        print(jcds.connection['jcds_base_url'])
        assert 'jcds_upload_token' in jcds.connection
        print(jcds.connection['jcds_upload_token'])
        jcds.copy_pkg(pkg_path)