def test_get_statuses_from_file(self): rp = RecipePlan("recipedir") mystatus = MASTFile("files/status_random.txt") self.assertRaises(MASTError, rp.get_statuses_from_file) mystatus.to_file("recipedir/status.txt") rp.ingredients['ing1']="I" rp.ingredients['ing2a']="I" rp.ingredients['ing2b']="I" self.assertRaises(MASTError,rp.get_statuses_from_file) rp.ingredients['ing3']="I" rp.get_statuses_from_file() statusdict=dict() statusdict={'ing1':'alpha','ing2a':'beta','ing2b':'gamma','ing3':'delta'} self.assertEquals(rp.ingredients, statusdict)
def test_get_statuses_from_file(self): rp = RecipePlan("recipedir") mystatus = MASTFile("files/status_random.txt") self.assertRaises(MASTError, rp.get_statuses_from_file) mystatus.to_file("recipedir/status.txt") rp.ingredients['ing1'] = "I" rp.ingredients['ing2a'] = "I" rp.ingredients['ing2b'] = "I" self.assertRaises(MASTError, rp.get_statuses_from_file) rp.ingredients['ing3'] = "I" rp.get_statuses_from_file() statusdict = dict() statusdict = { 'ing1': 'alpha', 'ing2a': 'beta', 'ing2b': 'gamma', 'ing3': 'delta' } self.assertEquals(rp.ingredients, statusdict)