Ejemplo n.º 1
0
 def test_Provides_stdout(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumstdout import StandardOutputMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('stdout'), StandardOutputMedium)
Ejemplo n.º 2
0
 def test_Raises_exception_on_unknown_name(self):
     from niprov.mediumfactory import MediumFactory
     factory = MediumFactory()
     with self.assertRaisesRegexp(ValueError, 'Unknown medium: poetry'):
        factory.create('poetry')
Ejemplo n.º 3
0
 def test_Provides_Viewer(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumviewer import ViewerMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('viewer'), ViewerMedium)
Ejemplo n.º 4
0
 def test_Provides_direct(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumdirect import DirectMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('direct'), DirectMedium)
Ejemplo n.º 5
0
 def test_Provides_file(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumfile import FileMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('file'), FileMedium)
Ejemplo n.º 6
0
 def test_Provides_stdout(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumstdout import StandardOutputMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('stdout'), StandardOutputMedium)
Ejemplo n.º 7
0
 def test_Provides_Viewer(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumviewer import ViewerMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('viewer'), ViewerMedium)
Ejemplo n.º 8
0
 def test_Raises_exception_on_unknown_name(self):
     from niprov.mediumfactory import MediumFactory
     factory = MediumFactory()
     with self.assertRaisesRegexp(ValueError, 'Unknown medium: poetry'):
         factory.create('poetry')
Ejemplo n.º 9
0
 def test_Provides_file(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumfile import FileMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('file'), FileMedium)
Ejemplo n.º 10
0
 def test_Provides_direct(self):
     from niprov.mediumfactory import MediumFactory
     from niprov.mediumdirect import DirectMedium
     factory = MediumFactory()
     self.assertIsInstance(factory.create('direct'), DirectMedium)