Skip to content

Instantly share code, notes, and snippets.

@bamthomas
Last active August 29, 2015 14:12
Show Gist options
  • Save bamthomas/b9213bd712d85aa4f3f6 to your computer and use it in GitHub Desktop.
Save bamthomas/b9213bd712d85aa4f3f6 to your computer and use it in GitHub Desktop.
Bad assert
def assert_dict_is_in_csv(exported_file_content, expected_line_dict):
lines = exported_file_content.rstrip('\r\n').split('\r\n')
for line in lines:
if all(['%s' % value in line for value in expected_line_dict.values()]):
return
raise AssertionError('%s not in file [%s]' % (expected_line_dict, lines))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment