partition_table: add a test for total partition size error

This commit is contained in:
Ivan Grokhotkov
2022-02-20 22:29:32 +03:00
parent f242a1705a
commit f071558117
8 changed files with 40 additions and 53 deletions

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import division, print_function
import io

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import division, print_function
import csv
@@ -467,6 +469,14 @@ ota_1, 0, ota_1, , 1M,
finally:
sys.stderr = sys.__stderr__
def test_size_error(self):
csv_txt = """
factory, app, factory, 0x10000, 20M
"""
with self.assertRaisesRegex(gen_esp32part.InputError, r'does not fit'):
t = gen_esp32part.PartitionTable.from_csv(csv_txt)
t.verify_size_fits(16 * 1024 * 1024)
class PartToolTests(Py23TestCase):

View File

@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import unittest
try: