-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpublisherTest.py
More file actions
24 lines (18 loc) · 806 Bytes
/
publisherTest.py
File metadata and controls
24 lines (18 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import unittest
import publisher
class PublisherTestCase(unittest.TestCase):
def setUp(self):
self.rule_types = ['actor', 'tag']
self.publisherName = "test"
self.xml = '<publisher name="test"><supportedRuleTypes>' + \
'<type>actor</type><type>tag</type></supportedRuleTypes></publisher>'
def tearDown(self):
pass
def testToXml(self):
a_publisher = publisher.Publisher(name=self.publisherName, rule_types=self.rule_types)
self.assertEqual(a_publisher.to_xml(), self.xml)
def testFromXml(self):
a_publisher = publisher.Publisher()
a_publisher.from_xml(self.xml)
self.assertEqual(a_publisher.name, self.publisherName)
self.assertEqual(a_publisher.rule_types, self.rule_types)