def test_android_hwpack_not_in_boot(self): """Test missing config file.""" try: tmpdir = tempfile.mkdtemp() boot_dir = os.path.join(tmpdir, "boot") os.mkdir(boot_dir) config_file = os.path.join(boot_dir, "config") expected = (False, config_file) self.assertEqual(expected, android_hwpack_in_boot_tarball(tmpdir)) finally: os.removedirs(boot_dir)
def test_android_hwpack_in_boot(self): """Test presence of config file in boot directory.""" try: tmpdir = tempfile.mkdtemp() boot_dir = os.path.join(tmpdir, "boot") os.mkdir(boot_dir) config_file = os.path.join(boot_dir, "config") expected = (True, config_file) with open(config_file, "w"): self.assertEqual(expected, android_hwpack_in_boot_tarball(tmpdir)) finally: os.unlink(config_file) os.removedirs(boot_dir)