test: add unit tests for WildflyPath
This commit is contained in:
parent
c0ac0e81a6
commit
a4d6ffefc6
@ -4,7 +4,8 @@ Unit tests for wildfly module
|
|||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
from six import string_types
|
from six import string_types
|
||||||
from wildfly import WildflyPath, format_attr, config_query, wildfly_batch
|
from wildfly import (WildflyPath, format_attr, config_query,
|
||||||
|
wildfly_batch, WildflyError)
|
||||||
|
|
||||||
class TestWildflyPath(unittest.TestCase):
|
class TestWildflyPath(unittest.TestCase):
|
||||||
'''
|
'''
|
||||||
@ -25,6 +26,18 @@ class TestWildflyPath(unittest.TestCase):
|
|||||||
r'/location=\/myapp\/multimedia'
|
r'/location=\/myapp\/multimedia'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_wildfly_path_path(self):
|
||||||
|
self.assertEqual(
|
||||||
|
self.instance.parts,
|
||||||
|
WildflyPath(self.instance).parts
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_wildfly_path_parts(self):
|
||||||
|
self.assertEqual(
|
||||||
|
self.instance.parts,
|
||||||
|
WildflyPath(self.instance.parts).parts
|
||||||
|
)
|
||||||
|
|
||||||
def test_wildfly_path_len(self):
|
def test_wildfly_path_len(self):
|
||||||
self.assertEqual(len(self.instance), 8)
|
self.assertEqual(len(self.instance), 8)
|
||||||
|
|
||||||
@ -37,6 +50,10 @@ class TestWildflyPath(unittest.TestCase):
|
|||||||
r'/location=\/myapp\/multimedia'
|
r'/location=\/myapp\/multimedia'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_wildfly_path_raises(self):
|
||||||
|
with self.assertRaises(WildflyError) as err:
|
||||||
|
WildflyPath(False)
|
||||||
|
|
||||||
|
|
||||||
class TestFormatAttr(unittest.TestCase):
|
class TestFormatAttr(unittest.TestCase):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user