示例#1
0
def _build_lots_of_customers_csv(target_csv_path, customer_count=1000):
    assert target_csv_path is not None

    _log.info('write lots of customers to "%s"', target_csv_path)
    randomizer = random.Random(2)
    with io.open(target_csv_path, "w", newline='', encoding='cp1252') as target_csv_file:
        csv_writer = _compat.csv_writer(target_csv_file)
        for customer_id in range(1, customer_count + 1):
            csv_writer.writerow(dev_test.create_test_customer_row(customer_id, randomizer))
示例#2
0
def _build_lots_of_customers_csv(target_csv_path, customer_count=1000):
    # TODO: Use a random seed to generate the same data every time.
    assert target_csv_path is not None

    _log.info('write lots of customers to "%s"', target_csv_path)
    with io.open(target_csv_path, "w", newline='',
                 encoding='cp1252') as target_csv_file:
        csv_writer = _compat.csv_writer(target_csv_file)
        for customerId in range(customer_count):
            csv_writer.writerow(dev_test.create_test_customer_row(customerId))
def _build_lots_of_customers_csv(target_csv_path, customer_count=1000):
    assert target_csv_path is not None

    _log.info('write lots of customers to "%s"', target_csv_path)
    randomizer = random.Random(2)
    with io.open(target_csv_path, "w", newline='',
                 encoding='cp1252') as target_csv_file:
        csv_writer = _compat.csv_writer(target_csv_file)
        for customer_id in range(1, customer_count + 1):
            csv_writer.writerow(
                dev_test.create_test_customer_row(customer_id, randomizer))
示例#4
0
 def test_can_create_test_customer_row(self):
     for customer_id in range(15):
         row = dev_test.create_test_customer_row(customer_id)
         self.assertTrue(row is not None)
         self.assertEqual(len(row), 5)
示例#5
0
 def test_can_create_test_customer_row(self):
     for customer_id in range(15):
         row = dev_test.create_test_customer_row(customer_id)
         self.assertTrue(row is not None)
         self.assertEqual(len(row), 6)