Code review comment for lp:~chipaca/ubuntu-push/sqlevelmap-in-session

Revision history for this message
Samuele Pedroni (pedronis) wrote :

98 +type clientSessionSuite struct {
99 + log logger.Logger
100 + lvls func() (levelmap.LevelMap, error)
101 +}
102 +
103 +type clientSqlevelsSessionSuite struct{ clientSessionSuite }
104 +
105 +var _ = Suite(&clientSessionSuite{})
106 +var _ = Suite(&clientSqlevelsSessionSuite{})
107 +
108 +func (cs *clientSessionSuite) SetUpSuite(c *C) {
109 + cs.lvls = levelmap.NewLevelMap
110 +}
111 +
112 +func (cs *clientSqlevelsSessionSuite) SetUpSuite(c *C) {
113 + cs.lvls = func() (levelmap.LevelMap, error) { return levelmap.NewSqliteLevelMap(":memory:") }
114 +}
115 +
116 func (cs *clientSessionSuite) SetUpTest(c *C) {
117 cs.log = helpers.NewTestLogger(c, "debug")
118 }

I find the order in which things occur here a bit strange (though go doesn't care), my impulse would be to put them at the end, but maybe this is better, I'm also unsure about putting the hooks into &clientSessionSuite{...} vs setting them in SetUpSuite

« Back to merge proposal