Merge pull request #1465 from dbungert/lp1927103-test

model/fs: test swap size 0
This commit is contained in:
Dan Bungert 2022-10-26 07:24:34 -06:00 committed by GitHub
commit 420b8c6c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from unittest import mock
import attr
from parameterized import parameterized
@ -995,3 +996,11 @@ class TestAlignmentData(unittest.TestCase):
ad = d1.alignment_data()
align_max = d1.size - ad.min_start_offset - ad.min_end_offset
self.assertEqual(gaps.largest_gap_size(d1), align_max)
class TestSwap(unittest.TestCase):
def test_basic(self):
m = make_model()
with mock.patch.object(m, '_should_add_swapfile', return_value=False):
cfg = m.render()
self.assertEqual({'size': 0}, cfg['swap'])