-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
224 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
catalog/app/containers/Bucket/CodeSamples/Package.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as React from 'react' | ||
import renderer from 'react-test-renderer' | ||
|
||
import PackageCodeSamples from './Package' | ||
|
||
jest.mock( | ||
'./Code', | ||
() => | ||
({ children }: { children: { label: string; contents: string }[] }) => ( | ||
<div> | ||
{children.map(({ label, contents }) => ( | ||
<dl key={label}> | ||
<dt>{label}:</dt> <dd>{contents}</dd> | ||
</dl> | ||
))} | ||
</div> | ||
), | ||
) | ||
|
||
describe('containers/Bucket/CodeSamples/Package', () => { | ||
it('renders catalog property', () => { | ||
const props = { | ||
bucket: 'bucket', | ||
name: 'name', | ||
hash: 'hash', | ||
hashOrTag: 'tag', | ||
path: 'path', | ||
catalog: 'catalog', | ||
} | ||
const tree = renderer.create(<PackageCodeSamples {...props} />).toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
catalog/app/containers/Bucket/CodeSamples/__snapshots__/Package.spec.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`containers/Bucket/CodeSamples/Package renders catalog property 1`] = ` | ||
<div> | ||
<dl> | ||
<dt> | ||
Python | ||
: | ||
</dt> | ||
<dd> | ||
import quilt3 as q3 | ||
# Browse [[https://docs.quiltdata.com/quilt-python-sdk-developers/api-reference/package#package.browse]] | ||
p = q3.Package.browse("name", top_hash="hash", registry="s3://bucket") | ||
# make changes to package adding individual files [[https://docs.quiltdata.com/quilt-python-sdk-developers/api-reference/package#package.set]] | ||
p.set("data.csv", "data.csv") | ||
# or whole directories [[https://docs.quiltdata.com/quilt-python-sdk-developers/api-reference/package#package.set_dir]] | ||
p.set_dir("subdir", "subdir") | ||
# and push changes [[https://docs.quiltdata.com/quilt-python-sdk-developers/api-reference/package#package.push]] | ||
p.push("name", registry="s3://bucket", message="Hello World") | ||
# Download (be mindful of large packages) [[https://docs.quiltdata.com/quilt-python-sdk-developers/api-reference/package#package.install]] | ||
q3.Package.install("name", path="path", top_hash="hash", registry="s3://bucket", dest=".") | ||
</dd> | ||
</dl> | ||
<dl> | ||
<dt> | ||
CLI | ||
: | ||
</dt> | ||
<dd> | ||
# Download package [[https://docs.quiltdata.com/quilt-python-sdk-developers/api-reference/cli#install]] | ||
quilt3 install "name" --path "path" --top-hash hash --registry s3://bucket --dest . | ||
</dd> | ||
</dl> | ||
<dl> | ||
<dt> | ||
URI | ||
: | ||
</dt> | ||
<dd> | ||
quilt+s3://bucket#package=name@hash&path=path&catalog=catalog | ||
</dd> | ||
</dl> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.