This change allows MetadataFactory.iterate_folders to recognize when
MetadataFactory has retrieved a malformed HTML file, or an HTML file
that does not contain the table and rows that it expects to see.
If the URL is correct, it should retrieve the right page, but this is
not guaranteed, and MetadataFactory should be able to recover and
generate an appropriate error message.
One possible situation where this kind of error might occur could be
when the user is connected to a public WIFI network, but not logged in.
The router would redirect aqt to the network login page, and aqt would
have no way of knowing that it did not receive the correct page.
Aqt should be resilient to this kind of error.
* Add tests for proper patching of Qt6.2.2-ios
* Add a build target for ios installations
* Add test coverage for mobile patching on linux
This change folds in some refactoring as well, in an attempt to reduce
repetitive logic, and make sure that this logic is used everywhere appropriate.
Causes `get_hash` to verify the hash length, and check that the hash can
be unhexlified properly.
Fixes the interface for `get_hash` so that the caller does not have to
run `binascii.unhexlify` or verify its output.
This requires that `get_hash` does a better job of checking what data is
sent to it. To pass these tests, `get_hash` must check that the hash
is the right length, that the hash can be unhexlified properly, and
that it does not compose an unusable url when it tries to run `getUrl`.
I don't think we can really call the `Updates.xml` files that we are
parsing 'untrusted xml', because we are checking that they match the
sha256 checksum. However, I don't think there's any good reason not to
use a more secure parsing algorithm.
`MetadataFactory.fetch_http` must often download HTML pages, not
Updates.xml files. download.qt.io does not store checksums for these
files, so this particular function must be allowed to download these
pages without using a checksum.
aqt.helper.MyConfigParser.getlist fails to retrieve a fallback list when
the `section` parameter does not exist in the `settings.ini` file.
This ensures that the fallback is used when that key is missing.
This uses a fixture to load the default settings file before each test.
Tests that require a different settings file (ie test_settings) can be
configured to skip this step using this line of code:
@pytest.mark.load_default_settings(False)
This change is necessary to be able to run these tests in isolation from
each other. The `altlink`, `getUrl` and `downloadBinaryFile` functions
are all dependent on Settings, and you cannot test them without loading
a Settings file first. Without this change, when these tests ran, they
used a Settings object loaded up in some previous test, which could have
loaded some Settings file that we do not want. If we try to run these
tests without loading a Settings file, they will just fail to run
because Settings doesn't exist yet.