Beispiel #1
0
 def test_single_part_too_small(self):  # type: () -> None
     pt = gen_table('1M')
     app = fake_file(1500, 'too_big.bin')
     with self.assertRaises(SystemExit) as e:
         check_sizes.check_partition('app', None, pt, app)
     self.assertIn('too small', str(e.exception))
     self.assertIn('too_big.bin', str(e.exception))
Beispiel #2
0
 def test_all_parts_too_small(self):  # type: () -> None
     pt = gen_table('500K', '500K', '500K')
     app = fake_file(501, 'just_too_big.bin')
     with self.assertRaises(SystemExit) as e:
         check_sizes.check_partition('app', None, pt, app)
     self.assertIn('All', str(e.exception))
     self.assertIn('too small', str(e.exception))
     self.assertIn('just_too_big.bin', str(e.exception))
Beispiel #3
0
 def test_one_part_too_small_warning(self):  # type: () -> None
     pt = gen_table('500K', '1M', '1M')
     app = fake_file(501, 'big.bin')
     # this will print a warning, no easy way to verify it looks correct
     check_sizes.check_partition('app', None, pt, app)
Beispiel #4
0
 def test_sizes_ok(self):  # type: () -> None
     pt = gen_table('1M')
     app = fake_file(512, 'test.bin')
     check_sizes.check_partition('app', None, pt, app)