def test_persists_data(self): """Tests that the application persists data""" dojo1 = Dojo() dojo1.create_room("office", "orange") dojo1.add_person("John", "Ashaba", "Staff", "Y") dojo1.save_state("mydb.db") dojo2 = Dojo() dojo2.load_state("mydb.db") room = dojo2.find_room("orange") self.assertIn(room, dojo2.all_rooms)
def test_persists_data(self): """Tests that the application persists data""" dojo1 = Dojo() dojo1.create_room("office", "orange") dojo1.add_person("John", "Ashaba", "Staff", "Y") if os.path.exists("resources/testdb.db"): os.remove("resources/testdb.db") dojo1.save_state("testdb.db") dojo2 = Dojo() dojo2.load_state("resources/testdb.db") room = find_room(dojo2.rooms, "orange") self.assertIn(room, dojo2.rooms)