-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logbook): add lib methods & plumbing commands for logbook
- Loading branch information
Showing
10 changed files
with
300 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
) | ||
|
||
func TestLogbookCommand(t *testing.T) { | ||
r := NewTestRepoRoot(t, "qri_test_logbook") | ||
defer r.Delete() | ||
|
||
ctx, done := context.WithCancel(context.Background()) | ||
defer done() | ||
|
||
cmdR := r.CreateCommandRunner(ctx) | ||
err := executeCommand(cmdR, "qri save --body=testdata/movies/body_ten.csv me/test_movies") | ||
if err != nil { | ||
t.Fatal(err.Error()) | ||
} | ||
|
||
cmdR = r.CreateCommandRunner(ctx) | ||
if err = executeCommand(cmdR, "qri save --body=testdata/movies/body_thirty.csv me/test_movies"); err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
cmdR = r.CreateCommandRunner(ctx) | ||
if err = executeCommand(cmdR, "qri logbook me/test_movies --raw"); err == nil { | ||
t.Error("expected using a ref and the raw flag to error") | ||
} | ||
|
||
cmdR = r.CreateCommandRunner(ctx) | ||
if err = executeCommand(cmdR, "qri logbook --raw"); err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
cmdR = r.CreateCommandRunner(ctx) | ||
if err = executeCommand(cmdR, "qri logbook me/test_movies"); err != nil { | ||
t.Fatal(err) | ||
} | ||
} |
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
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
Oops, something went wrong.