mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
clients: Convert tests to pytest style
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
parent
29b2d664b0
commit
8cd08c2a76
@ -18,8 +18,6 @@
|
|||||||
Test module for clients module.
|
Test module for clients module.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from plinth import clients
|
from plinth import clients
|
||||||
from plinth.modules.deluge.manifest import clients as deluge_clients
|
from plinth.modules.deluge.manifest import clients as deluge_clients
|
||||||
from plinth.modules.infinoted.manifest import clients as infinoted_clients
|
from plinth.modules.infinoted.manifest import clients as infinoted_clients
|
||||||
@ -28,25 +26,25 @@ from plinth.modules.syncthing.manifest import clients as syncthing_clients
|
|||||||
from plinth.modules.tor.manifest import clients as tor_clients
|
from plinth.modules.tor.manifest import clients as tor_clients
|
||||||
|
|
||||||
|
|
||||||
class TestClients(unittest.TestCase):
|
def test_of_type_web():
|
||||||
"""Test utilities provided by clients module."""
|
|
||||||
|
|
||||||
def test_of_type_web(self):
|
|
||||||
"""Test filtering clients of type web."""
|
"""Test filtering clients of type web."""
|
||||||
self.assertTrue(clients.of_type(syncthing_clients, 'web'))
|
assert clients.of_type(syncthing_clients, 'web')
|
||||||
self.assertFalse(clients.of_type(quassel_clients, 'web'))
|
assert not clients.of_type(quassel_clients, 'web')
|
||||||
|
|
||||||
def test_of_type_mobile(self):
|
|
||||||
|
def test_of_type_mobile():
|
||||||
"""Test filtering clients of type mobile."""
|
"""Test filtering clients of type mobile."""
|
||||||
self.assertTrue(clients.of_type(syncthing_clients, 'mobile'))
|
assert clients.of_type(syncthing_clients, 'mobile')
|
||||||
self.assertFalse(clients.of_type(infinoted_clients, 'mobile'))
|
assert not clients.of_type(infinoted_clients, 'mobile')
|
||||||
|
|
||||||
def test_of_type_desktop(self):
|
|
||||||
|
def test_of_type_desktop():
|
||||||
"""Test filtering clients of type desktop."""
|
"""Test filtering clients of type desktop."""
|
||||||
self.assertTrue(clients.of_type(syncthing_clients, 'desktop'))
|
assert clients.of_type(syncthing_clients, 'desktop')
|
||||||
self.assertFalse(clients.of_type(deluge_clients, 'desktop'))
|
assert not clients.of_type(deluge_clients, 'desktop')
|
||||||
|
|
||||||
def test_of_type_package(self):
|
|
||||||
|
def test_of_type_package():
|
||||||
"""Test filtering clients of type package."""
|
"""Test filtering clients of type package."""
|
||||||
self.assertTrue(clients.of_type(syncthing_clients, 'package'))
|
assert clients.of_type(syncthing_clients, 'package')
|
||||||
self.assertFalse(clients.of_type(tor_clients, 'package'))
|
assert not clients.of_type(tor_clients, 'package')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user