def test_binary(self): from faker.providers.misc import Provider for _ in range(999): length = random.randint(0, 2 ** 10) binary = Provider.binary(length) self.assertTrue(isinstance(binary, (bytes, bytearray))) self.assertTrue(len(binary) == length) for _ in range(999): self.generator.seed(_) binary1 = Provider.binary(_) self.generator.seed(_) binary2 = Provider.binary(_) self.assertTrue(binary1 == binary2)
def test_binary(self): from faker.providers.misc import Provider for _ in range(999): length = random.randint(0, 2 ** 10) binary = Provider.binary(length) self.assertTrue(isinstance(binary, (bytes, bytearray))) self.assertTrue(len(binary) == length) for _ in range(999): self.generator.seed(_) binary1 = Provider.binary(_) self.generator.seed(_) binary2 = Provider.binary(_) self.assertTrue(binary1 == binary2)
def test_binary(self): from faker.providers.misc import Provider provider = Provider(self.generator) for _ in range(999): length = random.randint(0, 2**10) binary = provider.binary(length) assert isinstance(binary, (bytes, bytearray)) assert len(binary) == length for _ in range(999): self.generator.seed(_) binary1 = provider.binary(_) self.generator.seed(_) binary2 = provider.binary(_) assert binary1 == binary2
def test_binary(self): from faker.providers.misc import Provider for _ in range(999): length = random.randint(0, 2**10) binary = Provider.binary(length) self.assertTrue(isinstance(binary, six.binary_type)) self.assertTrue(len(binary) == length)
def test_binary(self): from faker.providers.misc import Provider provider = Provider(self.generator) for _ in range(999): length = random.randint(0, 2 ** 10) binary = provider.binary(length) assert isinstance(binary, (bytes, bytearray)) assert len(binary) == length for _ in range(999): self.generator.seed(_) binary1 = provider.binary(_) self.generator.seed(_) binary2 = provider.binary(_) assert binary1 == binary2