Ejemplo n.º 1
0
class TestHDD(unittest.TestCase):

    #Arrange
    def setUp(self):
        self.program1 = Program(range(0,10), "Word")
        self.hdd = HDD(10)

    def test_getting_FS(self):
        fs = self.hdd.generate_file_system()
        self.assertEquals(fs.list_folders(), [], "FS Generated from clean disk have no folders")

    def test_serializing_to_HDD(self):
        fs = self.hdd.generate_file_system()
        fs.add_file("word", self.program1)
        self.hdd.serialize_file_system(fs)
        SUTFs = self.hdd.generate_file_system()
        amount_of_folders = len(SUTFs.list_files())
        self.assertEquals(amount_of_folders, 1, "Should have 1 file")
Ejemplo n.º 2
0
class TestHDD(unittest.TestCase):

    #Arrange
    def setUp(self):
        self.program1 = Program(range(0, 10), "Word")
        self.hdd = HDD(10)

    def test_getting_FS(self):
        fs = self.hdd.generate_file_system()
        self.assertEquals(fs.list_folders(), [],
                          "FS Generated from clean disk have no folders")

    def test_serializing_to_HDD(self):
        fs = self.hdd.generate_file_system()
        fs.add_file("word", self.program1)
        self.hdd.serialize_file_system(fs)
        SUTFs = self.hdd.generate_file_system()
        amount_of_folders = len(SUTFs.list_files())
        self.assertEquals(amount_of_folders, 1, "Should have 1 file")
Ejemplo n.º 3
0
 def setUp(self):
     self.instructions = range(0, 30)
     self.otherInstructions = range(0, 25)
     hdd = HDD(10)
     self.driveSaver = hdd.get_drive_saver()
Ejemplo n.º 4
0
 def setUp(self):
     self._hdd = HDD(10)
     self.folder = Folder(None, "/")
Ejemplo n.º 5
0
 def setUp(self):
     self.instructions = range(0, 30)
     self.otherInstructions = range(0, 25)
     hdd = HDD(10)
     self.driveSaver = hdd.get_drive_saver()
Ejemplo n.º 6
0
 def setUp(self):
     self.program1 = Program(range(0,10), "Word")
     self.hdd = HDD(10)
Ejemplo n.º 7
0
 def setUp(self):
     self.program1 = Program(range(0, 10), "Word")
     self.hdd = HDD(10)