def test_parse_input(self):
self.assertDictEqual(self.expected_parse, self.data_packer.parse_input())
self.assertEqual(self.expected_parse["T"], self.data_packer.T)
self.assertListEqual(self.expected_parse["challenges"], self.data_packer.challenges)
Number of challenges, followed by file and disc size info.
3 3 100 10 20 70 4 100 30 40 60 70 5 100 10 20 30 40 60
The number of discs needed to store the files.
Case #1: 2 Case #2: 2 Case #3: 3
unittest
constructs:setUp()
: Let's you keep access any data that you want to keep around for all (or most of) the tests.tearDown()
: The opposite of setUp()
fail()
: Force a test to fail. Useful in TDD when you're still in the process of writing your tests.assertEquals()
assertIsNone()
assertListEquals()
assertDictEquals()
assertRaises()