Skip to content

Instantly share code, notes, and snippets.

@wolendranh
Created March 11, 2016 14:16
Show Gist options
  • Save wolendranh/a2087178683af5c82223 to your computer and use it in GitHub Desktop.
Save wolendranh/a2087178683af5c82223 to your computer and use it in GitHub Desktop.
from unittest import TestCase
class ListCheckTestCase(TestCase):
def setUp(self):
self.bad_lst = ['itsppyura', 'itsppoleg', 'dev']
self.right_lst = ['itsppyura', 'itsppoleg']
def test_contain_string_pass(self):
self.assertEquals(filter(lambda x: x.startswith('itspp'), self.right_lst), self.right_lst)
def test_contain_string_fail(self):
self.assertEqual(filter(lambda x: x.startswith('itspp'), self.bad_lst), self.bad_lst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment