Example #1
0
 def test_Provides_json(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatjson import JsonFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('json'), JsonFormat)
Example #2
0
 def test_Provides_picture(self):
     from niprov.formatfactory import FormatFactory
     from niprov.pictures import PictureCache
     factory = FormatFactory()
     self.assertIsInstance(factory.create('picture'), PictureCache)
Example #3
0
 def test_Raises_exception_on_unknown_name(self):
     from niprov.formatfactory import FormatFactory
     factory = FormatFactory()
     with self.assertRaisesRegexp(ValueError, 'Unknown format: hexameter'):
         factory.create('hexameter')
Example #4
0
 def test_Provides_dict(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatdict import DictFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('dict'), DictFormat)
Example #5
0
 def test_Provides_object(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatobject import ObjectFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('object'), ObjectFormat)
Example #6
0
 def test_Provides_narrated(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatnarrated import NarratedFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('narrated'), NarratedFormat)
Example #7
0
 def test_Provides_simple(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatsimple import SimpleFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('simple'), SimpleFormat)
Example #8
0
 def test_Provides_json(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatjson import JsonFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('json'), JsonFormat)
Example #9
0
 def test_Provides_xml(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatxml import XmlFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('xml'), XmlFormat)
Example #10
0
 def test_Provides_picture(self):
     from niprov.formatfactory import FormatFactory
     from niprov.pictures import PictureCache
     factory = FormatFactory()
     self.assertIsInstance(factory.create('picture'), PictureCache)
Example #11
0
 def test_Raises_exception_on_unknown_name(self):
     from niprov.formatfactory import FormatFactory
     factory = FormatFactory()
     with self.assertRaisesRegexp(ValueError, 'Unknown format: hexameter'):
        factory.create('hexameter')
Example #12
0
 def test_Provides_object(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatobject import ObjectFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('object'), ObjectFormat)
Example #13
0
 def test_Provides_dict(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatdict import DictFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('dict'), DictFormat)
Example #14
0
 def test_Provides_simple(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatsimple import SimpleFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('simple'), SimpleFormat)
Example #15
0
 def test_Provides_narrated(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatnarrated import NarratedFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('narrated'), NarratedFormat)
Example #16
0
 def test_Provides_xml(self):
     from niprov.formatfactory import FormatFactory
     from niprov.formatxml import XmlFormat
     factory = FormatFactory()
     self.assertIsInstance(factory.create('xml'), XmlFormat)