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_normal(self, table_name, header_list, record_list, expected):
tabledata = TableData(table_name, header_list, record_list)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(tabledata)))
assert tabledata == expected
def test_normal_pattern_match(
self, table_name, header_list, record_list, pattern,
is_invert_match, expected):
tabledata = TableData(table_name, header_list, record_list)
actual = tabledata.filter_column(
pattern_list=pattern,
is_invert_match=is_invert_match,
is_re_match=True, pattern_match=PatternMatch.AND)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(actual)))
assert actual == expected
def test_normal_re_match(
self, table_name, header_list, record_list, pattern,
is_invert_match, expected):
tabledata = TableData(table_name, header_list, record_list)
actual = tabledata.filter_column(
pattern_list=pattern,
is_invert_match=is_invert_match,
is_re_match=True)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(actual)))
assert actual == expected
def test_normal(self, table_name, header_list, record_list, expected):
tabledata = TableData(table_name, header_list, record_list)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(tabledata)))
assert tabledata == expected
def test_normal(
self, table_name, header_list, record_list,
expected):
tabledata = TableData(table_name, header_list, record_list)
sanitizer = SQLiteTableDataSanitizer(tabledata)
new_tabledata = sanitizer.sanitize()
print("lhs: {}".format(ptw.dump_tabledata(new_tabledata)))
print("rhs: {}".format(ptw.dump_tabledata(expected)))
assert new_tabledata == expected
def test_normal_re_match(
self, table_name, header_list, record_list, pattern,
is_invert_match, expected):
tabledata = TableData(table_name, header_list, record_list)
actual = tabledata.filter_column(
pattern_list=pattern,
is_invert_match=is_invert_match,
is_re_match=True)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(actual)))
assert actual == expected
def test_normal(
self, table_name, header_list, record_list,
expected):
tabledata = TableData(table_name, header_list, record_list)
sanitizer = SQLiteTableDataSanitizer(tabledata)
new_tabledata = sanitizer.sanitize()
print("lhs: {}".format(ptw.dump_tabledata(new_tabledata)))
print("rhs: {}".format(ptw.dump_tabledata(expected)))
assert new_tabledata == expected
def test_normal_none_value(
self, table_name, header_list, record_list, expected):
tabledata = TableData(
table_name, header_list, record_list)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(tabledata)))
assert tabledata == expected
def test_normal_match(
self, table_name, header_list, record_list, pattern,
is_invert_match, expected):
tabledata = TableData(table_name, header_list, record_list)
actual = tabledata.filter_column(
pattern_list=pattern,
is_invert_match=is_invert_match)
print("expected: {}".format(ptw.dump_tabledata(expected)))
print("actual: {}".format(ptw.dump_tabledata(actual)))
assert actual == expected