From e7ef8105087baf13da2971e33e2634be4fc57b70 Mon Sep 17 00:00:00 2001 From: emdee Date: Mon, 26 Sep 2022 03:32:07 +0000 Subject: [PATCH] add wrapper/tox.c-toxcore.missing --- README.md | 9 +++- tests/README.md | 24 ++++++++++- tests/tests_wrapper.py | 8 ++-- wrapper/tox.c-toxcore.missing | 80 +++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 wrapper/tox.c-toxcore.missing diff --git a/README.md b/README.md index 1476085..aeec64b 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,18 @@ Taken from the wrapper directory of the now abandoned by Ingvar. The basics of NGC groups are supported, as well as AV and toxencryptsave. +There is no coverage of conferences as they are not supported in ```toxygen``` +and the list of still unwrapped calls as of Sept. 2022 can be found in +```tox.c-toxcore.missing```. + +It has been tested with UDP and TCP proxy (Tor). It has ***not*** been +tested on Windows, and there may be some breakage, which should be +easy to fix. ## Install Put the parent of the wrapper directory on your PYTHONPATH and -touch a file called `__init__.py` in the parent directory. +touch a file called `__init__.py` in its parent directory. ## Prerequisites diff --git a/tests/README.md b/tests/README.md index 13c7a5b..b309854 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,3 +1,14 @@ +These are the tests taken from +forked from https://github.com/aitjcize/PyTox by Wei-Ning Huang +. They have been converted to work with ```toxygen```. + +All of the dependencies on ```toxygen``` should have been removed, +but if you copy this directory to a subdirectory of ```toxygen/toxygen``` +then the tests may expand to testing some features of ```toxygen``` as well. +The tests are good examples of how to run Tox in Python. + +You can run the tests by running ```tests_socks.py```. + ``` usage: tests_socks.py [-h] [--proxy_host PROXY_HOST] [--proxy_port PROXY_PORT] [--proxy_type {0,1,2}] [--udp_enabled {True,False}] @@ -32,9 +43,20 @@ positional arguments: --logfile LOGFILE Filename for logging --loglevel LOGLEVEL Threshold for logging (lower is more) default: 20 --tcp_port TCP_PORT, --tcp-port TCP_PORT - tcp port --mode MODE Mode: 0=chat 1=chat+audio 2=chat+audio+video default: 0 --sleep {qt,gevent,time} Sleep method - one of qt, gevent , time ``` + +Look at the ```@unittest``` decorators in the code for tests that +are known to fail, or are unfinished. They will be skipped, but should +all be fixed and made to work. It has been tested with UDP and TCP proxy +(Tor). It has ***not*** been tested on Windows, and there may be some +breakage, which should be easy to fix. + +Currently: +``` +Ran 34 tests in 86.589s +OK (skipped=12) +``` diff --git a/tests/tests_wrapper.py b/tests/tests_wrapper.py index 36ff7b9..41e175e 100644 --- a/tests/tests_wrapper.py +++ b/tests/tests_wrapper.py @@ -663,11 +663,11 @@ class ToxSuite(unittest.TestCase): assert not self.bob.friend_exists(baid) def iNodeInfo(self, sProt, sHost, sPort, key=None, environ=None, bTest=False): - sFile = os.path.join("/tmp", sHost + '.nmap') - if sProt in ['socks', 'socks5', 'tcp4']: + sFile = os.path.join("/tmp", f"{sHost}.{os.getpid()}.nmap") + if True or sProt in ['socks', 'socks5', 'tcp4']: cmd = f"nmap -Pn -n -sT -p T:{sPort} {sHost} | grep /tcp >{sFile}" else: - cmd = f"nmap -Pn -n -sT -p U:{sPort} {sHost} | grep /tcp >{sFile}" + cmd = f"nmap -Pn -n -sU -p U:{sPort} {sHost} | grep /tcp >{sFile}" iRet = os.system(cmd) LOG.debug(f"iNodeInfo cmd={cmd} {iRet}") if iRet != 0: @@ -869,7 +869,7 @@ class ToxSuite(unittest.TestCase): assert self.alice.self_get_name_size() == len('Alice') @unittest.skip('loud') - @unittest.skipIf(bIS_NOT_TOXYGEN, 'not testing in toxygen') + @unittest.skipIf(bIS_NOT_TOXYGEN or oTOX_OARGS.mode == 0, 'not testing in toxygen') def test_sound_notification(self): # works """ Plays sound notification diff --git a/wrapper/tox.c-toxcore.missing b/wrapper/tox.c-toxcore.missing new file mode 100644 index 0000000..82fd0e7 --- /dev/null +++ b/wrapper/tox.c-toxcore.missing @@ -0,0 +1,80 @@ +tox_version_major +tox_version_minor +tox_version_patch +tox_version_is_compatible +tox_public_key_size +tox_secret_key_size +tox_conference_uid_size +tox_conference_id_size +tox_nospam_size +tox_address_size +tox_max_name_length +tox_max_status_message_length +tox_max_friend_request_length +tox_max_message_length +tox_max_custom_packet_size +tox_hash_length +tox_file_id_length +tox_max_filename_length +tox_max_hostname_length +tox_options_get_ipv6_enabled +tox_options_get_udp_enabled +tox_options_get_local_discovery_enabled +tox_options_get_dht_announcements_enabled +tox_options_get_proxy_type +tox_options_get_proxy_port +tox_options_get_start_port +tox_options_get_end_port +tox_options_get_tcp_port +tox_options_get_hole_punching_enabled +tox_options_get_savedata_type +tox_options_get_savedata_length +tox_options_get_experimental_thread_safety +tox_file_seek +tox_callback_conference_connected +tox_callback_conference_message +tox_callback_conference_title +tox_callback_conference_peer_list_changed +tox_conference_new +tox_conference_delete +tox_conference_peer_count +tox_conference_peer_get_name_size +tox_conference_peer_get_name +tox_conference_peer_get_public_key +tox_conference_peer_number_is_ours +tox_conference_offline_peer_count +tox_conference_offline_peer_get_name_size +tox_conference_offline_peer_get_name +tox_conference_offline_peer_get_public_key +tox_conference_offline_peer_get_last_active +tox_conference_set_max_offline +tox_conference_invite +tox_conference_join +tox_conference_send_message +tox_conference_get_title_size +tox_conference_get_title +tox_conference_set_title +tox_conference_get_chatlist_size +tox_conference_get_chatlist +tox_conference_get_type +tox_conference_get_id +tox_conference_by_id +tox_conference_get_uid +tox_conference_by_uid +tox_group_max_topic_length +tox_group_max_part_length +tox_group_max_group_name_length +tox_group_max_password_size +tox_group_chat_id_size +tox_group_peer_public_key_size +tox_group_peer_get_connection_status +tox_group_get_voice_state +tox_callback_group_voice_state +tox_group_get_topic_lock +tox_callback_group_topic_lock +tox_group_send_custom_private_packet +tox_callback_group_custom_private_packet +tox_group_founder_set_topic_lock +tox_group_founder_set_voice_state +tox_group_set_ignore +tox_group_mod_kick_peer