Home | History | Annotate | Download | only in server2
      1 #!/usr/bin/env python
      2 # Copyright 2014 The Chromium Authors. All rights reserved.
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 
      6 import unittest
      7 
      8 from docs_server_utils import StringIdentity
      9 
     10 
     11 class DocsServerUtilsTest(unittest.TestCase):
     12   '''Tests for methods in docs_server_utils.
     13   '''
     14 
     15   # TODO(kalman): There are a bunch of methods in docs_server_utils.
     16   # Test them all.
     17 
     18   def testStringIdentity(self):
     19     # The important part really is that these are all different.
     20     self.assertEqual('C+7Hteo/', StringIdentity('foo'))
     21     self.assertEqual('Ys23Ag/5', StringIdentity('bar'))
     22     self.assertEqual('T5FOBOjX', StringIdentity('foo', 'bar'))
     23     self.assertEqual('K7XzI1GD', StringIdentity('bar', 'foo'))
     24     self.assertEqual('CXypceHn', StringIdentity('foo', 'bar', 'baz'))
     25     self.assertEqual('gGo0GTF6', StringIdentity('foo', 'baz', 'bar'))
     26 
     27 
     28 if __name__ == '__main__':
     29   unittest.main()
     30