Esempio n. 1
0
    def setUp(self):
        logging.basicConfig(level=logging.DEBUG)
        self.repo_cli = cli.RepoCLI()
        self.artifact_cli = cli.ArtifactCLI()

        with open(ARTIFACT_LOCAL_PATH, 'w') as f:
            f.write('foo')

        self.artifact_cli = cli.ArtifactCLI()
Esempio n. 2
0
    def setUp(self):
        logging.basicConfig(level=logging.DEBUG)

        with open(ARTIFACT_LOCAL_PATH, 'w') as f:
            f.write(CONTENT)

        self.artifact_cli = cli.ArtifactCLI()
        os.environ['REPOSITORY_USER'] = config.USER

        if False:
            #soft = hard = MAX_MEMORY_USE_MB * 1000
            soft = hard = MAX_MEMORY_USE_MB * 1
            resource.setrlimit(resource.RLIMIT_DATA, (soft, hard))
Esempio n. 3
0
    def test_metadata(self):
        remote_artifacts = cli.ArtifactCLI().run(
            ['upload', ARTIFACT_LOCAL_PATH, config.REPO, GROUP])
        self.assertEquals(len(remote_artifacts), 1)
        remote_artifact = remote_artifacts[0]

        self.artifact_cli.run([
            'set-metadata', '{s}'.format(s=json.dumps(METADATA)),
            remote_artifact.repo_id,
            remote_artifact.get_coordinates_string()
        ])
        metadata_received_serialized = self.artifact_cli.run([
            'get-metadata', remote_artifact.repo_id,
            remote_artifact.get_coordinates_string()
        ])
        metadata_received = json.loads(metadata_received_serialized)
        self.assertTrue(
            set(METADATA.items()).issubset(set(metadata_received.items())))
        self.artifact_cli.run(['delete', remote_artifact.url])