Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_match_column_identifier_numeric(self):
self.assertEqual(2, match_column_identifier(self.headers, 3))
self.assertEqual(3, match_column_identifier(self.headers, 3, column_offset=0))
def test_match_column_which_could_be_integer_name_is_treated_as_positional_id(self):
self.assertEqual(0, match_column_identifier(self.headers, '1'))
self.assertEqual(1, match_column_identifier(self.headers, '1', column_offset=0))
def test_match_column_identifier_string(self):
self.assertEqual(2, match_column_identifier(self.headers, 'i_work_here'))
self.assertEqual(2, match_column_identifier(self.headers, 'i_work_here', column_offset=0))
def test_match_column_which_could_be_integer_name_is_treated_as_positional_id(self):
self.assertEqual(0, match_column_identifier(self.headers, '1'))
self.assertEqual(1, match_column_identifier(self.headers, '1', column_offset=0))
def test_match_column_identifier_string(self):
self.assertEqual(2, match_column_identifier(self.headers, 'i_work_here'))
self.assertEqual(2, match_column_identifier(self.headers, 'i_work_here', column_offset=0))
def test_match_column_identifier_numeric(self):
self.assertEqual(2, match_column_identifier(self.headers, 3))
self.assertEqual(3, match_column_identifier(self.headers, 3, column_offset=0))
self.lat_column = match_column_identifier(column_names, self.args.lat, self.args.zero_based)
self.lon_column = match_column_identifier(column_names, self.args.lon, self.args.zero_based)
if self.args.type:
self.type_column = match_column_identifier(column_names, self.args.type, self.args.zero_based)
else:
self.type_column = None
if self.args.geometry:
self.geometry_column = match_column_identifier(column_names, self.args.geometry, self.args.zero_based)
else:
self.geometry_column = None
if self.args.key:
self.id_column = match_column_identifier(column_names, self.args.key, self.args.zero_based)
else:
self.id_column = None
def __init__(self, args, column_names):
self.args = args
self.column_names = column_names
self.lat_column = match_column_identifier(column_names, self.args.lat, self.args.zero_based)
self.lon_column = match_column_identifier(column_names, self.args.lon, self.args.zero_based)
if self.args.type:
self.type_column = match_column_identifier(column_names, self.args.type, self.args.zero_based)
else:
self.type_column = None
if self.args.geometry:
self.geometry_column = match_column_identifier(column_names, self.args.geometry, self.args.zero_based)
else:
self.geometry_column = None
if self.args.key:
self.id_column = match_column_identifier(column_names, self.args.key, self.args.zero_based)
else:
self.id_column = None
def __init__(self, args, column_names):
self.args = args
self.column_names = column_names
self.lat_column = match_column_identifier(column_names, self.args.lat, self.args.zero_based)
self.lon_column = match_column_identifier(column_names, self.args.lon, self.args.zero_based)
if self.args.type:
self.type_column = match_column_identifier(column_names, self.args.type, self.args.zero_based)
else:
self.type_column = None
if self.args.geometry:
self.geometry_column = match_column_identifier(column_names, self.args.geometry, self.args.zero_based)
else:
self.geometry_column = None
if self.args.key:
self.id_column = match_column_identifier(column_names, self.args.key, self.args.zero_based)
else:
self.id_column = None
def __init__(self, args, column_names):
self.args = args
self.column_names = column_names
self.lat_column = match_column_identifier(column_names, self.args.lat, self.args.zero_based)
self.lon_column = match_column_identifier(column_names, self.args.lon, self.args.zero_based)
if self.args.type:
self.type_column = match_column_identifier(column_names, self.args.type, self.args.zero_based)
else:
self.type_column = None
if self.args.geometry:
self.geometry_column = match_column_identifier(column_names, self.args.geometry, self.args.zero_based)
else:
self.geometry_column = None
if self.args.key:
self.id_column = match_column_identifier(column_names, self.args.key, self.args.zero_based)
else: