this repo has no description
1#!/usr/bin/env python3
2# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
3
4import random
5import unittest
6
7
8class RandomTest(unittest.TestCase):
9 def test_seed_succeeds(self):
10 random.seed(0xDEADBEEF)
11
12 def test_seeded_randint(self):
13 random.seed(0xBA5EBA11, version=2)
14 self.assertEqual(
15 [random.randint(0, 1000) for _i in range(10)],
16 [519, 88, 712, 325, 296, 529, 436, 708, 381, 454],
17 )
18
19
20if __name__ == "__main__":
21 unittest.main()