Commit Graph

71 Commits

Author SHA1 Message Date
Hiroshi Miura
fddd634b6d style: remove unused field and apply black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-09-29 12:30:16 +09:00
Hiroshi Miura
2a8eb72c0b refactor: test: update cases and expectations
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-09-29 12:17:44 +09:00
Hiroshi Miura
6c2960dce7 fix: test: update expectations
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-08-05 08:01:13 +09:00
Hiroshi Miura
307d856f0c fix: remove logic to check combination
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-08-05 07:42:02 +09:00
Hiroshi Miura
c059593817 Merge pull request #705 from ddalcino/topic/ddalcino/cli/warn-ext7zr
Log a warning when aqtinstall falls back to an external 7z extraction tool
2023-09-12 07:35:30 +09:00
Dave Dalcino
5c2c18d96b Fix installation of win64_msvc2019_arm64 arch
This fixes the behavior of the `--autodesktop` flag and the updater,
when installing win64_msvc2019_arm64 for desktop targets.
2023-09-06 18:09:02 -07:00
Dave Dalcino
0ffc48a1b1 remove unused import 2023-08-28 05:28:46 -07:00
Dave Dalcino
112080e6cb black 2023-08-28 05:28:46 -07:00
Dave Dalcino
772c20aa4d Remove duplicated test 2023-08-28 05:28:45 -07:00
Dave Dalcino
85037194fe Remove fallback parameter 2023-08-28 05:28:45 -07:00
Dave Dalcino
9752164811 Add test for refactored _set_sevenzip 2023-08-28 05:28:45 -07:00
Dave Dalcino
9b102de2b4 Test Cli._select_unexpected_modules for missing qt
This adds coverage for the situation where there is no known list of
modules, since the Qt version is unknown.
2023-02-16 14:53:56 -08:00
Dave Dalcino
6a0c174e01 Improve warning messages re: unknown aqt arguments
This improves the warnings about unknown versions, modules, and
architectures of Qt, so that it is more explicit what the message
actually means.

This changes the purpose of `Cli._check_modules_arg` from checking if
modules exist in combinations.json, to returning a list of modules
that do not exist in that file. The function has been renamed as well.
This change was necessary to make the warning message more informative.
2023-02-16 14:01:39 -08:00
Dave Dalcino
e3c7d14c3f Add tests for qt 6.5.0 wasm 2023-02-11 10:35:48 -08:00
iakov
77910835c2 Make black happy with new formatting for tests 2023-02-03 20:12:01 +03:00
Dave Dalcino
c90b262984 remove extensions from ArchiveId 2022-11-16 16:14:55 -08:00
Dave Dalcino
caee04bcb3 Remove extensions 2022-11-16 16:14:54 -08:00
Dave Dalcino
d73c89a89f fix expected error message in test cases 2022-11-14 19:23:44 -08:00
Dave Dalcino
f63e0d9a64 Fix test_get_autodesktop_dir_and_arch for Windows 2022-08-20 09:56:40 -07:00
Dave Dalcino
bcd4e03838 Refactor test_install to mock multiple Qts
This will allow testing multiple qt installations, as required by the
feature that installs the default desktop qt where required

Add autodesktop test for ios
2022-08-20 09:09:36 -07:00
Dave Dalcino
703f2d2fe3 rework logic for readability 2022-08-20 09:09:23 -07:00
Dave Dalcino
78fe5f30eb Improve unit test coverage 2022-08-20 09:04:40 -07:00
Mozi
60889b7296 Log: left align the level name with padding (#539)
* Change log format for brief

- prepend %(levelname)s:

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Update test expectations for error/warning messages

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* log: left align the level name with padding

Why 8: sizeof("CRITICAL") == 8

Ref:
  printf-style String Formatting § Built-in Types — Python 3 documentation
  https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

* log: remove the duplicate "warning" words

Co-authored-by: Hiroshi Miura <miurahr@linux.com>
2022-07-18 22:29:16 +09:00
David Dalcino
b62db9ee2a Allow MetadataFactory.fetch_http to skip sha256
`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.
2022-03-06 18:16:37 -08:00
David Dalcino
05cc2347c7 Merge branch 'master' into topic-fix-453 2021-11-24 22:01:27 -08:00
David Dalcino
db4db6c9a4 Implement --archive-dest feature 2021-11-24 13:30:48 -08:00
David Dalcino
092d4e8c02 Add tests for list-src, list-doc, list-example 2021-11-23 11:08:07 -08:00
David Dalcino
621cd7a6c0 Fix implementation of aqt tool
This modifies `aqt tool` to allow `-` characters in tool versions, so
that `aqt tool` can pass the same unit tests that `install-tool` can.
This makes it less like the `aqt tool` from v1.2.5, but it should work
better with more tools with different version formats.
2021-10-30 19:23:35 -07:00
David Dalcino
4ab854291b Allow Cli._set_arch to receive SimpleSpec 2021-10-28 15:42:10 -07:00
Hiroshi Miura
42564a6f9e PEP8/Black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-10-19 13:22:14 +09:00
Hiroshi Miura
7accb6f699 Expectation of help message
argparse auto generate message changes a little in 3.10

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-10-16 11:50:47 +09:00
David Dalcino
d5213142a8 Fix misuse of disable_socket (#415)
In an earlier PR, I added calls to `disable_socket()` from
`pytest_socket` where I thought they were needed to prevent some tests
from accessing the network, in case they weren't monkeypatched properly.
Today, I discovered that `disable_socket()` disables sockets globally
for all tests, which means that the tests that use remote data cannot
run if they are executed after another test calls `disable_socket()`.

This change calls `disable_socket()` once from `conftest.py`, so that
no tests are allowed to use network data unless they are marked as ok
to use the network, with `@pytest.mark.enable_socket`. See example of
usage in `tests/test_connection.py`.

Changed return code for unexpected exceptions:

This allows us to write tests that can discover whether an unexpected
exception occurred just by checking the return code, rather than reading
stderr. This will allow us to write less friable tests that don't break
every time some insignificant output details change.

This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.

This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
2021-10-05 14:40:05 +09:00
David Dalcino
e093b6bdf5 fix import mistake 2021-09-30 19:27:57 -07:00
David Dalcino
c5b89f6170 fail on mismatched tool versions
This recreates the legacy behavior, where `aqt tool` would fail to
install a tool variant when the version in the xml file does not match
the version requested in cli arguments.

This also recreates a bug where `aqt tool` cannot install tools that
do not have a valid semantic version.
2021-09-30 19:15:32 -07:00
David Dalcino
4d1b09287e Fix disable_socket() usage 2021-09-30 18:02:17 -07:00
David Dalcino
9fee65ab56 Add test for aqt tool with 4 pos arguments
`test_cli_legacy_commands_with_wrong_syntax` relies on `argparse` to
filter out bad argument lists; the new test uses a mocked getUrl that
raises ArchiveDownloadError.
2021-09-30 14:31:19 -07:00
David Dalcino
a4de09df98 Add tests for the legacy commands 2021-09-30 09:41:09 -07:00
David Dalcino
b67749e4fc Add tests 2021-09-17 14:48:57 -07:00
David Dalcino
1a918c35c5 Merge remote-tracking branch 'upstream/master' into specify-version-by-simplespec 2021-09-09 08:26:10 -07:00
David Dalcino
65293b82ee Implement install-qt by spec 2021-09-07 14:34:26 -07:00
David Dalcino
7856631120 Add tests for new installer exceptions raised 2021-09-06 13:09:27 -07:00
David Dalcino
387bd4a61a Add test for unexpected exceptions 2021-09-06 11:15:27 -07:00
David Dalcino
174daf80d7 Add Cli exception tests 2021-09-01 16:09:53 -07:00
David Dalcino
ebea5231cf Update test_cli: expect cli.run not to raise 2021-09-01 11:44:19 -07:00
Hiroshi Miura
a767956a5b Coding style update by Black/isort
Change to max line length to 125

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-02 13:41:41 +09:00
David Dalcino
55c6e94636 Improve language of help text 2021-08-01 13:25:19 -07:00
David Dalcino
9982f56613 Fix syntax of new subcommands in tests 2021-08-01 13:25:05 -07:00
Hiroshi Miura
59b8522cd2 test: cli: Update test expectation
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-01 20:56:26 +09:00
David Dalcino
c3d202730c Update tests to use list-qt/list-tool syntax 2021-07-22 09:47:39 -07:00
Hiroshi Miura
a5bb6b7e96 Introduce metadata package (#305)
* Introduce metadata module

that has Versions and ListCommand class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Introduce custom Version class

A Version class override semantic_version.Version class
that accept qt versions and tools versions

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8/Black

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Improve test assertion

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Move ArchiveId class to metadata module

And Improve imports

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring Version class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring Table class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring Table class(wip)

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Fix output format of `list tools` command

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* list: Improve print output

avoid str.join()

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-13 00:10:36 +09:00