Skip to content

Instantly share code, notes, and snippets.

@VitamintK
Created March 11, 2015 12:47
Show Gist options
  • Save VitamintK/24953b6b4d6ef43f47e3 to your computer and use it in GitHub Desktop.
Save VitamintK/24953b6b4d6ef43f47e3 to your computer and use it in GitHub Desktop.
def setUp(self):
self.mybag = Bag(['d','a','b','d','c','b','d'])
def test_len(self):
self.assertEqual(len(self.mybag), 7)
for removal in ['d','a','b','d','c','b','d']:
baglen = len(self.mybag)
self.mybag.remove(removal)
self.assertEqual(baglen - 1, len(self.mybag))
self.assertEqual(0, len(self.mybag))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment