def test_quote_whitespaces_empty_result(): """Test the quote_whitespaces() function with no results.""" data = [] headers = ['h1', 'h2'] expected = ([], ['h1', 'h2']) assert expected == quote_whitespaces(data, headers)
def test_quote_whitespaces_non_spaces(): """Test the quote_whitespaces() function with non-spaces.""" data = [["\tbefore", "after \r"], ["\n both ", "none"]] headers = ['h1', 'h2'] expected = ([["'\tbefore'", "'after \r'"], ["'\n both '", "'none'"]], ['h1', 'h2']) assert expected == quote_whitespaces(data, headers)
def test_quote_whitespaces_non_spaces(): """Test the quote_whitespaces() function with non-spaces.""" data = [["\tbefore", "after \r"], ["\n both ", "none"]] headers = ["h1", "h2"] expected = ([["'\tbefore'", "'after \r'"], ["'\n both '", "'none'"]], ["h1", "h2"]) results = quote_whitespaces(data, headers) assert expected == (list(results[0]), results[1])
def test_quote_whitespaces(): """Test the quote_whitespaces() function.""" data = [[" before", "after "], [" both ", "none"]] headers = ['h1', 'h2'] expected = ([["' before'", "'after '"], ["' both '", "'none'"]], ['h1', 'h2']) assert expected == quote_whitespaces(data, headers)
def test_quote_whitespaces_empty_result(): """Test the quote_whitespaces() function with no results.""" data = [] headers = ["h1", "h2"] expected = ([], ["h1", "h2"]) results = quote_whitespaces(data, headers) assert expected == (list(results[0]), results[1])