Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: go/src/infra/appengine/test-results/model/masters_test.go

Issue 2234353002: test-results: package model: Add full_result.go and tests (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Improve coverage Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: go/src/infra/appengine/test-results/model/masters_test.go
diff --git a/go/src/infra/appengine/test-results/model/masters_test.go b/go/src/infra/appengine/test-results/model/masters_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..f0d6d0fbb7a293f0ecfba5e08f94ceaad618bca5
--- /dev/null
+++ b/go/src/infra/appengine/test-results/model/masters_test.go
@@ -0,0 +1,45 @@
+package model
+
+import (
+ "testing"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestMasters(t *testing.T) {
+ t.Parallel()
+
+ Convey("Masters", t, func() {
+ Convey("Known Masters", func() {
+ Convey("ByName", func() {
+ Convey("existing", func() {
+ So(MasterByName("TryServerChromiumMac"), ShouldResemble, &Master{
+ Name: "TryServerChromiumMac",
+ Identifier: "tryserver.chromium.mac",
+ Groups: []string{"Unused"},
+ })
+ })
+
+ Convey("not existing", func() {
+ So(MasterByName("FooBar"), ShouldBeNil)
+ So(MasterByName("tryserver.chromium.mac"), ShouldBeNil)
+ })
+ })
+
+ Convey("ByIdentifier", func() {
+ Convey("existing", func() {
+ So(MasterByIdentifier("tryserver.chromium.linux"), ShouldResemble, &Master{
+ Name: "TryServerChromiumLinux",
+ Identifier: "tryserver.chromium.linux",
+ Groups: []string{"Unused"},
+ })
+ })
+
+ Convey("not existing", func() {
+ So(MasterByIdentifier("foo.bar"), ShouldBeNil)
+ So(MasterByIdentifier("TryServerChromiumLinux"), ShouldBeNil)
+ })
+ })
+ })
+ })
+}

Powered by Google App Engine
This is Rietveld 408576698