~jonas-drange/ubuntu-push/lp1577723-skiptest

« back to all changes in this revision

Viewing changes to identifier/testing/testing_test.go

  • Committer: Guillermo Gonzalez
  • Date: 2014-08-04 20:40:50 UTC
  • mto: This revision was merged to the branch mainline in revision 293.
  • Revision ID: guillermo.gonzalez@canonical.com-20140804204050-0tbj2xmmy6cs9a6u
replace whoopsie with /var/lib/dbus/machine-id

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 Copyright 2013-2014 Canonical Ltd.
 
3
 
 
4
 This program is free software: you can redistribute it and/or modify it
 
5
 under the terms of the GNU General Public License version 3, as published
 
6
 by the Free Software Foundation.
 
7
 
 
8
 This program is distributed in the hope that it will be useful, but
 
9
 WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
11
 PURPOSE.  See the GNU General Public License for more details.
 
12
 
 
13
 You should have received a copy of the GNU General Public License along
 
14
 with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
*/
 
16
 
 
17
package testing
 
18
 
 
19
import (
 
20
        identifier ".."
 
21
        . "launchpad.net/gocheck"
 
22
        "testing"
 
23
)
 
24
 
 
25
// hook up gocheck
 
26
func Test(t *testing.T) { TestingT(t) }
 
27
 
 
28
type IdentifierSuite struct{}
 
29
 
 
30
var _ = Suite(&IdentifierSuite{})
 
31
 
 
32
// TestSettableDefaultValueVisible tests that SettableIdentifier's default
 
33
// value is notable.
 
34
func (s *IdentifierSuite) TestSettableDefaultValueVisible(c *C) {
 
35
        id := Settable()
 
36
        c.Check(id.String(), Equals, "<Settable>")
 
37
}
 
38
 
 
39
// TestSettableSets tests that SettableIdentifier is settable.
 
40
func (s *IdentifierSuite) TestSettableSets(c *C) {
 
41
        id := Settable()
 
42
        id.Set("hello")
 
43
        c.Check(id.String(), Equals, "hello")
 
44
}
 
45
 
 
46
// TestFailingStringNotEmpty tests that FailingIdentifier still has a
 
47
// non-empty string.
 
48
func (s *IdentifierSuite) TestFailingStringNotEmpty(c *C) {
 
49
        id := Failing()
 
50
        c.Check(id.String(), Equals, "<Failing>")
 
51
}
 
52
 
 
53
// TestIdentifierInterface tests that FailingIdentifier and
 
54
// SettableIdentifier implement Id.
 
55
func (s *IdentifierSuite) TestIdentifierInterface(c *C) {
 
56
        _ = []identifier.Id{Failing(), Settable()}
 
57
}