Commit Graph

154 Commits

Author SHA1 Message Date
Yann Leboulanger 912f0e921d fix imports and many py3 changements 2013-01-02 13:54:02 +01:00
Yann Leboulanger d27591076f fix exception handling 2013-01-01 23:18:36 +01:00
Yann Leboulanger 414e349345 python uses unicode internally 2013-01-01 19:44:25 +01:00
Yann Leboulanger e71188a6fa print -> print() 2013-01-01 19:36:56 +01:00
Yann Leboulanger f832900d2b coding standards 2012-08-22 12:55:57 +02:00
Yann Leboulanger 49bc202421 merge from trunk 2011-12-29 11:39:02 +01:00
Yann Leboulanger 98432f6666 cean chatstate code: remove XEP-0022 support and use caps to know if a contact supports it 2011-08-27 22:41:55 +02:00
Yann Leboulanger f0a0929d5c merge XEP-0198 implementation from gajim-XEP-198 branch to trunk. Thanks Jefry for your work during GSOC 2011-08-22 09:45:51 +02:00
Jefry Lagrange f4cc439a7e add test for connection 2011-08-15 12:16:17 -04:00
Jefry Lagrange 92b932ca07 added testing suite for socks5 2011-08-01 23:13:56 -04:00
Jefry Lagrange 2d624a7b96 test case for jingle 2011-07-17 18:28:38 -04:00
Jefry Lagrange e02088e91c added tests for smacks.py 2011-06-15 19:12:55 -04:00
Yann Leboulanger be942a0270 don't open twice the same subscription request dialog. see #6762 2011-05-23 22:35:19 +02:00
Yann Leboulanger 98c46f2b56 fix test suite 2010-08-27 11:47:38 +02:00
Éric Araujo 9b5ee1e13b convert tabs to spaces in source code thanks to reindent.py
Also use sed to remove now unneeded Vim lines, 2to3 -f ws_comma to fix
some whitespace, and fix some other madness manually.
2010-04-08 01:20:17 +02:00
Yann Leboulanger fa05d88b2b merge from default branch 2010-02-08 22:25:41 +01:00
Yann Leboulanger 956accf010 Bye bye glade, Hi gtk builder. Fixes #4945 2010-01-22 19:57:59 +01:00
Yann Leboulanger 3a76966c14 merge from default branch 2010-01-19 16:37:14 +01:00
Stephan Erb e9caf06992 Split common/caps.py. We now have common/protocol/ to contain XMPP connection related classes.
Plan is to move our ConnectionX classess to the protocol package one by one. Each move should be more than a simple copy paste. It should be preceeded by cleanups and the like.
2009-12-10 20:06:46 +01:00
Stephan Erb 7708e3b87e Refactor internas of ConnectionCaps
* Make it testable and write a very basic test for the presenceCallback
 * Use Extract Method to make the code more readable and to increase reusability
 * Start to decouple ConnectionCaps from the other Connection classes/handlers
2009-12-10 18:31:00 +01:00
Stephan Erb 79b226d3f8 Make tests run again.
Missed to reflect API changes in the tests.
2009-12-05 22:26:48 +01:00
Yann Leboulanger 1b22a33239 add a HTML message parsser test 2009-11-18 11:22:48 +01:00
Stephan Erb a3ea00f4ea Remove different dicts for tune, activity and mood and from now on only use the common 'pep' dict.
The pep dict contacts the different UserPEP classes.
2009-11-15 23:52:43 +01:00
Mateusz Biliński 70731dbab7 Merged default branch into plugin-system branch. 2009-11-14 21:15:27 +01:00
Yann Leboulanger 45533ae134 Test body received in several part 2009-11-12 22:25:00 +01:00
Stephan Erb ee5eb8b546 Try to handle incomplete HTTP. See #5401. Please test.
Approach: Keep filling the receive buffer until we have found enough data to extract the first HTTP header and body
2009-11-12 21:23:10 +01:00
Stephan Erb af3af5bec8 Remove caps which have not been seen for three months from the db.
Thanks Asterix for the initial version of this patch!
2009-11-11 23:14:51 +01:00
Stephan Erb ae9376ff63 Split the 'account sensitive' parts of the Contacts class and move them to an intermediate Contacts_New class.
The Contact class remains the public interface for contact handling. This is only a single step of a longer refactoring to empower the Account class.
2009-11-10 22:56:10 +01:00
Stephan Erb b4285302db Make the GC_Contacts class 'account insensitive'. Instead, create an Account class which holds a GC_Contacts object.
The API has been preserved. For now the old Contacts() API has not been changed.
2009-11-10 21:08:25 +01:00
Stephan Erb ba9ef8301b Remove superfluous clear_contacts method 2009-11-09 23:03:16 +01:00
Stephan Erb cec93b6135 Push method to check if a specific ClientCaps supports a feature down to the caps module.
Public interfaces stay the same.
2009-11-09 21:26:56 +01:00
Stephan Erb a87693c735 Remove auto-generated smoketests 2009-11-05 20:54:32 +01:00
Stephan Erb 0abb1dfd20 Extract class: MetacontactManager from Contacts
For easy migration, interface is still preserved.
2009-11-05 19:43:25 +01:00
Stephan Erb 7829e7d40c Removed unused module 'meta.py' 2009-11-05 17:05:13 +01:00
Stephan Erb dec25246df Missing bits of the last commit (add account parameter to contact constructor) 2009-11-05 16:22:21 +01:00
Stephan Erb 06129f45ef Let contact instances know their corresponding account.
contact.account and gc_contact.account contains the account name of the owning account. There is still code around in many placed which tries to workaround this missing information. Such code has to be migrated on per-need basis.
2009-11-05 15:57:43 +01:00
Stephan Erb 2e5bf4d0d2 Organize tests into unit and integration tests.
Integration tests can depend on UI, network or both. Unittests use neither.
2009-11-05 09:06:46 +01:00
Stephan Erb 3a98a4170c Move Interface() god class from gajim.py to gui_interface.py. 2009-11-03 22:14:19 +01:00
Stephan Erb 47700e67da Rename CacheItem.update to CacheItem.set_and_store as this seems more intense giving. 2009-10-31 09:14:55 +01:00
Stephan Erb 99e8487db9 Move compute_caps_hash from helpers to caps module. 2009-10-30 23:55:03 +01:00
Stephan Erb 47f875a4bc Move CapsCache global from gajim.capscache to caps.capscache. 2009-10-30 23:01:25 +01:00
Stephan Erb bd714f66fc Move common part of Contact and GC_Contact into a new CommonContact class.
The CommonClass helps to spot easily where GC_Contacts and Contacts differ. This is just the first step a potential refactoring in this area.
2009-10-28 23:37:40 +01:00
Stephan Erb 33fe53ff7d Swtich from old to new caps API.
Now we do:

contact.supports(feauture) instead of gajim.capscache.is_supported(contact, feature)
2009-10-27 22:41:39 +01:00
Stephan Erb c7ff97703f Redistribute responsibility: Let contact instances check if features are supported 2009-10-27 20:31:09 +01:00
Stephan Erb 3295b08b26 Two small caps enhancements.
* Rename EntityCapabilities to ClientCaps as this seems more intense giving.
 * Add ability to blacklist features where we cannot savely assume that a client, which did not advertise caps, supports them
2009-10-26 19:20:16 +01:00
Stephan Erb 700665151c Implement 'supports' on contact instances.
Usage:

	if contact.supports(NS_E2E):
		....
2009-10-25 23:56:14 +01:00
Stephan Erb 396a2c603d Implement and test a supports_feature() method to directly test for supported featues on EntityCapabilites 2009-10-25 22:46:45 +01:00
Stephan Erb ca03f88fc3 Write tests and fix the caps preload alternative on the EntityCapabilities. 2009-10-25 22:32:18 +01:00
Stephan Erb 0440aec980 Improve common/caps.py test coverage. 2009-10-25 21:17:32 +01:00
Stephan Erb b97cd5bbf8 Remove unused imports. 2009-10-24 20:49:34 +02:00
Stephan Erb 2654ee9d56 Work around failing testcases.
It looks like those have not been run for month. A few are failing. They are now commented and wait for a proper fix. (Deferred)
2009-10-08 16:29:10 +02:00
Mateusz Biliński 018bda5a5f Merged default branch with plugin-system branch. Not all elements are fully
functional. This should be considered as sync commit.
2009-06-07 00:00:03 +02:00
Yann Leboulanger 752a6e72cb test_sessions require gtk 2009-04-08 07:30:40 +00:00
Yann Leboulanger b7c43f433b re-enable tests on commit time 2009-04-06 18:34:20 +00:00
Yann Leboulanger 4388e18c77 fix typo in resolver test 2009-04-06 18:33:30 +00:00
Yann Leboulanger fe8ca9b26a fix xmpp transport tests. Fixes #4829 2009-04-06 15:45:56 +00:00
Yann Leboulanger c5acd3f655 fix dispatcher tests. Fixes #4830 2009-04-06 13:36:29 +00:00
Yann Leboulanger d3ebaf5d8d fix test_xmpp_client_nb test unit 2009-04-06 13:18:56 +00:00
Yann Leboulanger 3d559033cb fix Mock class: child of object class and fix realClass usage 2009-04-06 13:07:12 +00:00
Yann Leboulanger a0d0a9b56c fix function name 2009-04-06 13:05:03 +00:00
Stephan Erb a757177e45 Improve code coverage of our testsuites and do some refactoring.
* resolver does not depend on GTK anymore
 * renamed a few modules for consistency
 * moved all mocks to lib/
 * let client_nb test work again. Was broken here

There are many failing tests, help appreciated :-)
2009-01-11 13:49:03 +00:00
Stephan Erb a1f346e48a Remove duplicated coded in test_client_nb.py 2008-12-24 14:53:00 +00:00
Stephan Erb 62a334b8fd Comment some prints in xmpp_mocks.py. Should be merged with test/lib/mocks.py 2008-12-24 14:50:50 +00:00
Stephan Erb 53d1fa6f66 Small cleanups to test_nonblockingtcp.py without much value. 2008-12-24 14:46:21 +00:00
Stephan Erb c5aff6f37c Make test_resolver work again after IdleQueue move. 2008-12-24 14:44:07 +00:00
Stephan Erb f1b831fd90 Temporary disable regression tests on commit. 2008-12-24 13:43:42 +00:00
Yann Leboulanger b317ffcdae merge BOSH branch to trunk 2008-12-15 21:06:08 +00:00
Yann Leboulanger 38eadfae5e [thorstenp] remove some useless space at eol 2008-12-03 22:44:02 +00:00
Yann Leboulanger 158538b81c [thorstenp] rename some var to not hide builts-in functions (list -> list_, ...) 2008-10-11 10:22:04 +00:00
Yann Leboulanger 196dd7e30a [thorstenp] use isinstance rather than type(x) == y. use sorted() 2008-10-11 09:59:52 +00:00
Yann Leboulanger 73aee40542 [thorstenp] replace none equality test with identity test 2008-10-11 09:44:12 +00:00
Yann Leboulanger 567f1e17c1 [thorstenp] di not use emtpy except clauses 2008-10-11 09:37:13 +00:00
Yann Leboulanger 9d7c80d522 [thorstenp] replace has_key by key in dict. Fixes #4392 2008-10-07 20:41:59 +00:00
Yann Leboulanger 3d46bf0b6e [dwd] fix reconnection when we get wrong XML with undeclared namespaces. Fixes #3083 2008-09-27 14:26:50 +00:00
tomk a7c36048b9 - renamed src/common/nslookup.py to resolver.py
- refactored resolver code and added asynchronous resolver based on patch by Damien Thebault[1]
  * Uses libasyncns-python[2]. If it's not available, old nslookup resolver is used)
  * works for SRV requests only at the moment

[1] https://www.lagaule.org/pipermail/gajim-devel/2008-July/000460.html
[2] https://code.launchpad.net/libasyncns-python
2008-08-31 23:40:06 +00:00
Stephan Erb a16c65873a Small enhancements for test_roster_window.
* Make sure that contacts show up under the correct parent
* Add check support for SelfContacts
2008-08-28 22:07:40 +00:00
Stephan Erb 9f52881d6e Fix option handling of the unittest runner. 2008-08-27 18:55:18 +00:00
Yann Leboulanger 5b6da9fbe0 fix dispatcher test. <x:y> in a message are not allowed 2008-08-27 07:56:02 +00:00
Yann Leboulanger 8a83033816 add some options to runtests.py to be able to tune verbosity and wether we want to run tests that require X or not 2008-08-27 07:55:06 +00:00
Yann Leboulanger ea99cb3682 coding standards 2008-08-27 07:51:05 +00:00
Yann Leboulanger 12f2c89070 coding standards 2008-08-27 07:49:41 +00:00
Yann Leboulanger b5753fec60 test hash computation in caps test 2008-08-27 07:49:11 +00:00
Stephan Erb 0bc1ac47f7 Unittest to reproduce #4208. With some tweaks to data.py it should also help to reproduce #4195. 2008-08-18 22:15:45 +00:00
Brendan Taylor 559a8c8b13 status change tests, hopefully fix some status change issues 2008-08-09 06:10:04 +00:00
Brendan Taylor 198a0ca738 moved testing libraries into their own directory 2008-08-09 00:24:08 +00:00
Brendan Taylor 83d9ef49a3 a script for running all the tests 2008-08-08 23:53:44 +00:00
Stephan Erb d1150f4d02 Implement some basic RosterWindow tests.
I just want the skeleton to be in place for feature bug fixing :-)
2008-08-06 20:17:00 +00:00
js 8605cd3f38 For historical reasons, we have a tab width of 3. This is strange, but
we have that in all files. To at least lesser the confusion a bit, add
vim tags for that.
Additionally, fix wrong #! in a few files.
2008-07-29 19:49:31 +00:00
tomk 3d860f40a6 BOSHClient transformed to NonBlockingBOSH transport - it's easier to maintain more connections from below, implemented handling of non-persistent HTTP connections - it runs with ejabberd, improved NonBlockingTransport interface, minor changes in BOSHDispatcher 2008-07-13 22:22:58 +00:00
tomk f3820706fb - Refactored non-blocking transport and client classes - getaddrinfo is called
in Client now
- Added NonBlockingHttpBOSH transport (to tranports_nb) and BOSHClient
(to client_nb)
- Extended possible proxy types in configuration by "BOSH" proxy
- Rewrote NonBlockingTLS to invoke success callback only after successful TLS handshake is over (formerly, the TLS Plugin returned right after sending <starttls>)
2008-06-30 00:02:32 +00:00
Brendan Taylor f6609d5bc5 indentation bug in the test environment setup 2008-06-29 22:31:17 +00:00
Brendan Taylor 90d849f945 added test for parsing of unbound namespace prefixes 2008-06-29 17:06:30 +00:00
Brendan Taylor 59f9d7dc2e test for URL regexp 2008-06-29 05:25:59 +00:00
Brendan Taylor e3613be1fa first pass at stripping out the one-tab-per-session code 2008-06-26 23:36:58 +00:00
tomk 65644ca13f added stub for new transports module plus basic test for it, testing code reorganized 2008-06-18 23:58:19 +00:00
tomk 16e274b9ec added test script for NonBlockingClient (test/test_client_nb.py) 2008-06-12 23:54:46 +00:00
Brendan Taylor 82b30c0791 CapsCache: made docstring match the API, fixed minor bugs, added tests 2008-06-12 03:56:47 +00:00
Brendan Taylor de21abe97b split off test initialization code 2008-06-12 03:56:30 +00:00
tomk 6a15c9b9c9 initial cleanup of xmpppy perfomed, see #3260 2008-06-09 00:32:02 +00:00
Brendan Taylor cc307aed70 split mock objects into their own module 2008-06-03 23:54:22 +00:00