~free.ekanayaka/landscape-client/jaunty-1.5.4-0ubuntu0.9.04.0

« back to all changes in this revision

Viewing changes to landscape/lib/tests/test_scriptcontent.py

  • Committer: Bazaar Package Importer
  • Author(s): Christopher Armstrong
  • Date: 2008-10-09 11:40:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20081009114051-jku4tay2vm4envzf
Tags: 1.0.23-0ubuntu0.8.10
* New upstream release. (LP: #277658):
  Changes since 1.0.21.1:
  - Don't print duplicate warnings when / is nearing capacity in sysinfo
    (LP: #260230).
  - Slight change to link text in landscape-sysinfo.
  - Don't crash badly when programs are run as the incorrect user
    (LP: #268879).
* debian/changelog: New debian-version scheme including Ubuntu version. The
  same upstream version is available for all supported releases.
  (LP: #277682).
* debian/landscape-client.postrm: Delete log and data files upon purge
  (LP: #121182).
* debian/landscape-common.postrm: Delete the sysinfo logs upon purge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import unittest
 
2
 
 
3
from landscape.lib.scriptcontent import (build_script,
 
4
    generate_script_hash)
 
5
 
 
6
class ScriptContentTest(unittest.TestCase):
 
7
 
 
8
    def test_concatenate(self):
 
9
        self.assertEquals(build_script(u"/bin/sh", u"echo 1.0\n"), 
 
10
                          "#!/bin/sh\necho 1.0\n")
 
11
 
 
12
    def test_concatenate_null_strings(self):
 
13
        self.assertEquals(build_script(None, None), 
 
14
                          "#!\n")
 
15
 
 
16
    def test_generate_script_hash(self):
 
17
        hash1 = generate_script_hash("#!/bin/sh\necho 1.0\n")
 
18
        hash2 = generate_script_hash("#!/bin/sh\necho 1.0\n")
 
19
        hash3 = generate_script_hash("#!/bin/sh\necho 3.0\n")
 
20
 
 
21
        self.assertEquals(hash1, hash2)
 
22
        self.assertNotEqual(hash1, hash3)
 
23
        self.assertTrue(isinstance(hash1, str))