Commits

Rodrigo Bistolfi  committed fcdc90b

Created test for creating more than one partition in a row

  • Participants
  • Parent commits 0d3edba

Comments (0)

Files changed (1)

File vinstall/backend/partitioning.py

     def setUp(self):
         (fd, self.path) = tempfile.mkstemp(prefix="fake-device-")
         f = os.fdopen(fd)
-        f.seek(1400000)
+        f.seek(2**32)
         os.write(fd, "0")
 
     def tearDown(self):
         p.write_changes()
         self.assertEqual(len(disk._disk.partitions), 1)
 
+    def test_add_partition_twice(self):
+        device = parted.Device(self.path)
+        disk = media.Disk()
+        disk._device = device
+        p = DiskPartitioner(disk)
+        p.create_partition_table()
+        p.add_partition(size=0.1)
+        p.add_partition(size=3)
+        p.write_changes()
+        self.assertEqual(len(disk._disk.partitions), 2)
+
+
     def test_has_partition_table(self):
         device = parted.Device(self.path)
         disk = media.Disk()