File size: 498 Bytes
998bb30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import unittest

from gat.runtime.utils import fix_random, randid


class TestUtils(unittest.TestCase):

    def test_fix_random(self):
        try:
            fix_random(0)
            self.assertTrue(True)
        except Exception as e:
            self.fail(f'fix_random raised an exception: {e}')

    def test_randid(self):
        length = 4
        result = randid(length)
        self.assertEqual(len(result), length)


if __name__ == '__main__':
    unittest.main()