def test_s3_save(self): with mock_s3(): client = boto3.client("s3") client.create_bucket(Bucket="fake-matrix-bucket", ACL="public-read-write") example = next(self.matrix_stores()) project_storage = ProjectStorage("s3://fake-matrix-bucket") tosave = CSVMatrixStore(project_storage, [], "test") tosave.matrix = example.matrix tosave.metadata = example.metadata tosave.save() tocheck = CSVMatrixStore(project_storage, [], "test") assert tocheck.metadata == example.metadata assert tocheck.matrix.to_dict() == example.matrix.to_dict()
def test_s3_save(): with mock_s3(): client = boto3.client("s3") client.create_bucket(Bucket="fake-matrix-bucket", ACL="public-read-write") for example in matrix_stores(): if not isinstance(example, CSVMatrixStore): continue project_storage = ProjectStorage("s3://fake-matrix-bucket") tosave = CSVMatrixStore(project_storage, [], "test") tosave.metadata = example.metadata tosave.matrix_label_tuple = example.matrix_label_tuple tosave.save() tocheck = CSVMatrixStore(project_storage, [], "test") assert tocheck.metadata == example.metadata assert tocheck.design_matrix.to_dict() == example.design_matrix.to_dict()
def test_s3_save(self): with mock_s3(): import boto3 client = boto3.client('s3') client.create_bucket(Bucket='fake-matrix-bucket', ACL='public-read-write') example = next(self.matrix_stores()) project_storage = ProjectStorage('s3://fake-matrix-bucket') tosave = CSVMatrixStore(project_storage, [], 'test') tosave.matrix = example.matrix tosave.metadata = example.metadata tosave.save() tocheck = CSVMatrixStore(project_storage, [], 'test') assert tocheck.metadata == example.metadata assert tocheck.matrix.to_dict() == example.matrix.to_dict()