add wrapper/tox.c-toxcore.missing

This commit is contained in:
emdee 2022-09-26 03:32:07 +00:00
parent 83d0e1998f
commit e7ef810508
4 changed files with 115 additions and 6 deletions

View file

@ -1,3 +1,14 @@
These are the tests taken from <https://github.com/oxij/PyTox>
forked from https://github.com/aitjcize/PyTox by Wei-Ning Huang
<aitjcize@gmail.com>. 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)
```

View file

@ -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