~sergiusens/snappy/inhibitSystemCtl

« back to all changes in this revision

Viewing changes to snappy/click_test.go

  • Committer: Sergio Schvezov
  • Date: 2015-04-06 17:30:16 UTC
  • Revision ID: sergio.schvezov@canonical.com-20150406173016-k4hqgr6j1tyww2gr
Fixing tests:
- Check for len 0 for system hooks when inhibiting.
- Make it easier on editors that trim empty spaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
449
449
        // it go de-activated and finally 2.0 got activated
450
450
        content, err := ioutil.ReadFile(filepath.Join(s.tempdir, "hook.trace"))
451
451
        c.Assert(err, IsNil)
452
 
        c.Assert(string(content), Equals, `now: ./bar_app_1.0.tracehook
453
 
now: 
454
 
now: ./bar_app_2.0.tracehook
455
 
`)
 
452
        expected := fmt.Sprintf("now: ./bar_app_1.0.tracehook\nnow: \nnow: ./bar_app_2.0.tracehook\n")
 
453
        c.Assert(string(content), Equals, expected)
456
454
}
457
455
 
458
456
func (s *SnapTestSuite) TestClickCopyDataHookFails(c *C) {
655
653
        _, err := installClick(snapFile, InhibitHooks, nil)
656
654
        c.Assert(err, IsNil)
657
655
 
658
 
        c.Assert(allSystemctl[0], Equals, "enable")
659
 
        c.Assert(allSystemctl, HasLen, 1)
 
656
        c.Assert(allSystemctl, HasLen, 0)
660
657
}
661
658
 
662
659
const expectedService = `[Unit]