Make sure the test went without unnecessary reconnects

This commit is contained in:
shortcutme 2019-03-27 03:10:58 +01:00
parent 9b36c55422
commit a3f957427f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 5 additions and 1 deletions

View file

@ -45,10 +45,11 @@ class TestConnection:
# Close connection # Close connection
connection.close() connection.close("Test ended")
client.stop() client.stop()
time.sleep(0.01) time.sleep(0.01)
assert len(file_server.connections) == 0 assert len(file_server.connections) == 0
assert file_server.num_incoming == 2 # One for file_server fixture, one for the test
def testRawConnection(self, file_server): def testRawConnection(self, file_server):
client = ConnectionServer(file_server.ip, 1545) client = ConnectionServer(file_server.ip, 1545)

View file

@ -52,9 +52,12 @@ class TestSiteDownload:
assert len(site_temp.content_manager.contents) == len(site.content_manager.contents) - 1 assert len(site_temp.content_manager.contents) == len(site.content_manager.contents) - 1
assert not bad_files assert not bad_files
assert file_server.num_incoming == 2 # One for file_server fixture, one for the test
assert site_temp.storage.deleteFiles() assert site_temp.storage.deleteFiles()
[connection.close() for connection in file_server.connections] [connection.close() for connection in file_server.connections]
def testArchivedDownload(self, file_server, site, site_temp): def testArchivedDownload(self, file_server, site, site_temp):
# Init source server # Init source server
site.connection_server = file_server site.connection_server = file_server