Exemple #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)
Exemple #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)
Exemple #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')
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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')
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)