| 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() | |