INNER CODE UNIT · Python

http_status_code_should_be

helm/chartmuseum · acceptance_tests/lib/ChartMuseum.py:13

    def http_status_code_should_be(self, expected_status, actual_status):
        if int(expected_status) != int(actual_status):
            raise AssertionError('Expected HTTP status code to be %s but was %s.'
                                 % (expected_status, actual_status))

    def start_chartmuseum(self, storage):
        self.stop_chartmuseum()
        os.chdir(self.rootdir)
        cmd = 'KILLME=1 chartmuseum --debug --port=%d --storage="%s" ' % (common.PORT, storage)
        if storage == 'local':
            shutil.rmtree(common.STORAGE_DIR, ignore_errors=True)
            cmd += '--storage-local-rootdir=%s >> %s 2>&1' % (common.STORAGE_DIR, common.LOGFILE)
        elif storage == 'amazon':
            cmd += '--storage-amazon-bucket="%s" --storage-amazon-prefix="%s" --storage-amazon-region="%s" >> %s 2>&1' \
                  % (common.STORAGE_AMAZON_BUCKET, common.STORAGE_AMAZON_PREFIX, common.STORAGE_AMAZON_REGION, common.LOGFILE)
        elif storage == 'google':
            cmd += '--storage-google-bucket="%s" --storage-google-prefix="%s" >> %s 2>&1' \
                   % (common.STORAGE_GOOGLE_BUCKET, common.STORAGE_GOOGLE_PREFIX, common.LOGFILE)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…