Beispiel #1
0
    def test(self):
        if not _should_test_aws():
            return

        key = str(uuid.uuid4()) + '/' + self.FOO
        path = 's3://' + TEST_AWS_REPO_BUCKET + '/' + key

        s3 = boto3.resource('s3')

        with open(self.FOO, 'rb') as fd:
            s3.Bucket(TEST_AWS_REPO_BUCKET).put_object(Key=key, Body=fd.read())

        stage = self.dvc.run(outs=[self.FOO],
                             deps=[path],
                             cmd='aws s3 cp {} {}'.format(path, self.FOO))

        with open(self.BAR, 'rb') as fd:
            s3.Bucket(TEST_AWS_REPO_BUCKET).put_object(Key=key, Body=fd.read())

        stages = self.dvc.reproduce(stage.path)

        self.assertEqual(len(stages), 1)
        self.assertTrue(filecmp.cmp(self.FOO, self.BAR))
Beispiel #2
0
 def should_test(self):
     return _should_test_aws()