Revision fabee4b2 test/ganeti.utils_unittest.py

b/test/ganeti.utils_unittest.py
1054 1054
    FormatTime(int(time.time()))
1055 1055

  
1056 1056

  
1057
class TestFingerprintFile(unittest.TestCase):
1058
  def setUp(self):
1059
    self.tmpfile = tempfile.NamedTemporaryFile()
1060

  
1061
  def test(self):
1062
    self.assertEqual(utils._FingerprintFile(self.tmpfile.name),
1063
                     "da39a3ee5e6b4b0d3255bfef95601890afd80709")
1064

  
1065
    utils.WriteFile(self.tmpfile.name, data="Hello World\n")
1066
    self.assertEqual(utils._FingerprintFile(self.tmpfile.name),
1067
                     "648a6a6ffffdaa0badb23b8baf90b6168dd16b3a")
1068

  
1069

  
1057 1070
class TestUnescapeAndSplit(unittest.TestCase):
1058 1071
  """Testing case for UnescapeAndSplit"""
1059 1072

  

Also available in: Unified diff